/* İletişim Formu - Frontend Stilleri */

.if-contact-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.if-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.if-form-group {
    margin-bottom: 20px;
}

.if-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.if-required {
    color: #dc3232;
    font-weight: bold;
}

.if-input,
.if-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.if-input {
    height: 46px;
}

.if-input:focus,
.if-textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* ===================== */
/* E-posta Doğrulama Alanı */
.if-email-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}

:root {
    --if-control-h: 46px;
}

/* Input düzeltme */
.if-email-wrapper .if-input {
    height: auto !important;
    min-height: var(--if-control-h);
    margin: 0;
    box-sizing: border-box;
}

/* Buton düzeltme */
.if-verify-btn {
    background: #0073aa;
    color: #ffffff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    padding: 0 20px;

    min-height: var(--if-control-h) !important;
    height: auto !important;
    line-height: normal !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.if-verify-btn:hover {
    background: #005a87;
    border-color: #005a87;
}

.if-verify-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.if-email-wrapper .if-input,
.if-email-wrapper .if-verify-btn {
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}
/* ===================== */

.if-verification-group {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.if-verification-wrapper { position: relative; }

.if-verification-input {
    font-size: 18px;
    letter-spacing: 5px;
    text-align: center;
    font-weight: 600;
}

.if-verification-status {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.if-verification-status.valid { color: #46b450; }
.if-verification-status.invalid { color: #dc3232; }

.if-resend-btn {
    margin-top: 10px;
    background: transparent;
    color: #0073aa;
    padding: 8px 15px;
    border: 1px solid #0073aa;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.if-resend-btn:hover { background: #0073aa; color: #ffffff; }

.if-textarea {
    resize: vertical;
    font-family: inherit;
}

/* Dosya Yükleme Alanı */
.if-file-input-wrapper { position: relative; }
.if-file-input {
    position: absolute;
    opacity: 0; width: 0; height: 0;
}
.if-file-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #f7f7f7;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.if-file-label:hover { background: #f0f0f0; border-color: #0073aa; }
.if-file-icon { margin-right: 8px; font-size: 18px; }
.if-file-text { font-size: 14px; color: #555; }
.if-file-name {
    display: none;
    margin-top: 8px;
    font-size: 13px;
    color: #0073aa;
}
.if-file-clear {
    margin-left: 10px;
    color: #dc3232;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
    padding: 0;
    transition: color 0.2s;
}
.if-file-clear:hover { color: #a00; }
.if-help-text {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* Hata Mesajları */
.if-error {
    display: block;
    color: #dc3232;
    font-size: 13px;
    margin-top: 5px;
}
.if-input.error,
.if-textarea.error { border-color: #dc3232; }

/* Gönder Butonu */
.if-submit-btn {
    background: #0073aa;
    color: #ffffff;
    padding: 14px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.if-submit-btn:hover { background: #005a87; }
.if-submit-btn:disabled { background: #ccc; cursor: not-allowed; }

.if-spinner { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Mesaj Kutuları */
.if-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}
.if-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.if-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Tasarım */
@media screen and (max-width: 600px) {
    .if-contact-form-wrapper { padding: 10px; }
    .if-form { padding: 20px; }
    .if-email-wrapper { grid-template-columns: 1fr; }
    .if-verify-btn { width: 100%; }
    .if-submit-btn { padding: 12px 20px; font-size: 14px; }
}

/* Dark Mode Desteği */
@media (prefers-color-scheme: dark) {
    .if-form {
        background: #1e1e1e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    .if-label { color: #e0e0e0; }
    .if-input,
    .if-textarea {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    .if-input:focus,
    .if-textarea:focus {
        border-color: #4a9eff;
        box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
    }
    .if-file-label { background: #2a2a2a; border-color: #444; }
    .if-file-label:hover { background: #333; border-color: #4a9eff; }
    .if-file-text { color: #b0b0b0; }
    .if-help-text { color: #999; }
}
/* === E-posta satırı: nihai hizalama === */
:root { --if-control-h: 46px; } /* 44 veya 48 de kullanabilirsin */

.if-email-wrapper{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;   /* her ikisini de tam aynı yüksekliğe zorla */
  gap: 10px;
}

/* Input ve buton için tam aynı kutu yüksekliği (border dahil) */
.if-email-wrapper .if-input{
  box-sizing: border-box;
  height: var(--if-control-h) !important;  /* border dahil sabit */
  padding-top: 12px;                        /* mevcut padding'in */
  padding-bottom: 12px;                     /* korunması için */
  margin: 0;
}

.if-verify-btn{
  box-sizing: border-box;
  height: var(--if-control-h) !important;   /* border dahil sabit */
  line-height: normal !important;
  padding: 0 20px;                          /* yatay boşluk */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tarayıcı farklarını azalt */
.if-email-wrapper .if-input,
.if-email-wrapper .if-verify-btn{
  -webkit-appearance: none;
  appearance: none;
  vertical-align: middle;
}
/* Label ve yıldız aynı satırda kalsın */
.if-label {
    display: inline-flex;   /* block yerine */
    align-items: center;    /* dikey ortalama */
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    gap: 4px;               /* yazı ile yıldız arası boşluk */
}

.if-required {
    color: #dc3232;
    font-weight: bold;
    margin-left: 2px;       /* çok yapışık olursa */
}

/* ===================== */
/* Mobil Responsive Tasarım */
/* ===================== */

@media screen and (max-width: 768px) {
    /* Mobilde e-posta wrapper dikey olsun */
    .if-email-wrapper {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Input tam genişlikte */
    .if-email-wrapper .if-input {
        width: 100%;
    }
    
    /* Buton tam genişlikte */
    .if-verify-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Form padding'ini küçült */
    .if-form {
        padding: 20px;
    }
    
    /* Wrapper padding'ini küçült */
    .if-contact-form-wrapper {
        padding: 10px;
    }
    
    /* Doğrulama input wrapper */
    .if-verification-wrapper {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }
    
    /* Yeni kod gönder butonu tam genişlikte */
    .if-resend-btn {
        width: 100%;
        margin-top: 10px !important;
    }
}

@media screen and (max-width: 480px) {
    /* Çok küçük ekranlarda daha da optimize et */
    .if-form {
        padding: 15px;
        border-radius: 6px;
    }
    
    .if-label {
        font-size: 13px;
    }
    
    .if-input,
    .if-textarea,
    .if-verify-btn {
        font-size: 16px; /* iOS zoom engellemek için */
    }
}