/* ═══════════════════════════════════════════════════════
   AŞK-I TURKUAZ — Gezgin Giriş / Kayıt Modal
   Turkuaz/teal tasarım paleti
   ═══════════════════════════════════════════════════════ */

/* ── Overlay ── */
.am-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity .25s ease;
}

/* SweetAlert2 her zaman auth modal'ın üstünde olmalı */
.swal2-container {
    z-index: 20000 !important;
}

.am-overlay.active {
    display: flex;
    opacity: 1;
}

/* ── Card ── */
.am-card {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, .35);
    transform: translateY(12px) scale(.98);
    opacity: 0;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .3s;
    animation: am-rise .3s cubic-bezier(.16, 1, .3, 1) forwards;
}

.am-overlay.active .am-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

@keyframes am-rise {
    from { transform: translateY(12px) scale(.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Scrollbar */
.am-card::-webkit-scrollbar {
    width: 6px;
}
.am-card::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

/* ── Close ── */
.am-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    z-index: 2;
}

.am-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* ── Tabs ── */
.am-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    background: #f1f5f9;
    padding: .35rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
}

.am-tab {
    border: none;
    background: transparent;
    padding: .7rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    color: #64748b;
    font-size: .88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: all .25s;
}

.am-tab i {
    font-size: .85rem;
}

.am-tab:hover {
    color: var(--teal, #14b8a6);
}

.am-tab.active {
    background: #fff;
    color: var(--teal, #14b8a6);
    box-shadow: 0 4px 14px rgba(20, 184, 166, .18);
}

/* ── Panels ── */
.am-panel {
    display: none;
    animation: am-fade .35s cubic-bezier(.16, 1, .3, 1);
}

.am-panel.active {
    display: block;
}

@keyframes am-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.am-header {
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.am-back {
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.am-back:hover {
    background: var(--teal-wash, #e6fffa);
    color: var(--teal, #14b8a6);
    border-color: var(--teal-soft, #99f6e4);
}

.am-title {
    font-family: var(--font-display, 'Georgia', serif);
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 .4rem;
    line-height: 1.2;
}

.am-sub {
    color: #64748b;
    font-size: .88rem;
    line-height: 1.55;
    margin: 0;
}

/* ── Form ── */
.am-form {
    display: flex;
    flex-direction: column;
    gap: .95rem;
}

.am-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.am-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.am-field label {
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
}

.am-field label .req {
    color: #ef4444;
    margin-left: .1rem;
}

/* ── Input Wrapper ──
   .am-input-wrap = valid.js için .form-group rolü (error-message buraya eklenir)
   .input-icon-wrapper = input + ikonların bulunduğu asıl kutu (ikonların referansı) */
.am-input-wrap {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 0 !important; /* valid.js .form-group margin'ini override */
}

.am-input-wrap .input-icon-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.am-input-wrap input {
    width: 100%;
    display: block;
    box-sizing: border-box;
    padding: .85rem 1rem .85rem 2.55rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: .93rem;
    color: #0f172a;
    background: #fff;
    transition: all .2s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.am-input-wrap.has-eye input {
    padding-right: 2.8rem;
}

.am-input-wrap input::placeholder {
    color: #94a3b8;
}

.am-input-wrap input:focus {
    outline: none;
    border-color: var(--teal, #14b8a6);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, .12);
}

.am-ico {
    position: absolute;
    left: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .92rem;
    pointer-events: none;
    transition: color .2s;
    z-index: 2;
}

.am-input-wrap:focus-within .am-ico {
    color: var(--teal, #14b8a6);
}

/* Eye toggle — valid.js sarmasından sonra da doğru konumlansın */
.am-eye {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .3rem;
    border-radius: 6px;
    transition: color .2s, background .2s;
    z-index: 3;
    line-height: 1;
}

.am-eye:hover {
    color: var(--teal, #14b8a6);
    background: rgba(20, 184, 166, .08);
}

/* Şifre alanlarında validation-icon göz ile çakışmasın */
.am-input-wrap.has-eye .input-icon-wrapper .validation-icon {
    right: 2.4rem !important;
}

/* Password strength meter (valid.js tarafından eklenen) */
.am-form .password-strength {
    margin-top: .3rem;
    height: 4px;
    border-radius: 999px;
}

/* DynamicFormValidator hata/başarı stilleri override */
.am-form .form-group.error input {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

.am-form .form-group.success input {
    border-color: #10b981 !important;
}

.am-form .form-group .error-message {
    font-size: .76rem;
    color: #ef4444;
    margin-top: .2rem;
    font-weight: 500;
}

.am-form .form-group .error-message::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: .35rem;
}

/* Validation ikon default pozisyon */
.am-form .input-icon-wrapper .validation-icon {
    right: .95rem !important;
}

/* ── Row: Remember + Forgot ── */
.am-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: -.2rem 0 .3rem;
    font-size: .82rem;
}

/* ── Check ── */
.am-check {
    display: inline-flex;
    align-items: flex-start;
    gap: .55rem;
    cursor: pointer;
    color: #475569;
    font-size: .82rem;
    line-height: 1.5;
    user-select: none;
}

.am-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: .1rem;
    accent-color: var(--teal, #14b8a6);
    cursor: pointer;
    flex-shrink: 0;
}

.am-check-kvkk {
    padding: .85rem 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.am-check a {
    color: var(--teal, #14b8a6);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Link button (inline text link) ── */
.am-link {
    background: transparent;
    border: none;
    color: var(--teal, #14b8a6);
    cursor: pointer;
    font-size: inherit;
    font-weight: 600;
    padding: 0;
    text-decoration: none;
    transition: color .2s;
}

.am-link:hover {
    color: var(--teal-dark, #0f766e);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Submit button ── */
.am-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .9rem 1.5rem;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .25s;
    width: 100%;
    margin-top: .5rem;
}

.am-btn-primary {
    background: linear-gradient(135deg, var(--teal, #14b8a6), var(--teal-dark, #0f766e));
    color: #fff;
    box-shadow: 0 8px 20px -6px rgba(20, 184, 166, .45);
}

.am-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -6px rgba(20, 184, 166, .55);
}

.am-btn-primary:active {
    transform: translateY(0);
}

.am-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Switch line (Hesabınız yok mu?) ── */
.am-switch {
    text-align: center;
    color: #64748b;
    font-size: .86rem;
    margin: 1.1rem 0 0;
}

/* ═══════════════════════════════════════
   HEADER USER MENU (giriş yapmış kullanıcı)
   ═══════════════════════════════════════ */
.header-user {
    position: relative;
}

.header-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem;
    border-radius: 999px;
    background: var(--teal-wash, #e6fffa);
    color: var(--teal-dark, #0f766e);
    border: 1px solid var(--teal-soft, #99f6e4);
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.header-user-trigger:hover {
    background: var(--teal, #14b8a6);
    color: #fff;
    border-color: var(--teal, #14b8a6);
}

.header-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--teal, #14b8a6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.header-user-trigger:hover .header-user-avatar {
    background: #fff;
    color: var(--teal, #14b8a6);
}

.header-user-menu {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .18);
    border: 1px solid #e2e8f0;
    min-width: 240px;
    padding: .6rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all .2s;
    z-index: 50;
}

/* Trigger ile menü arasındaki boşlukta hover kaybolmasın — görünmez köprü */
.header-user-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -.65rem;
    height: .75rem;
    background: transparent;
}

/* Hover ile de açılsın (click ile de çalışır — .open class'ı JS tarafından eklenir) */
.header-user:hover .header-user-menu,
.header-user.open .header-user-menu,
.header-user:focus-within .header-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover sırasında trigger rengi de aktif görünsün */
.header-user:hover .header-user-trigger {
    background: var(--teal, #14b8a6);
    color: #fff;
    border-color: var(--teal, #14b8a6);
}

.header-user:hover .header-user-trigger .header-user-avatar {
    background: #fff;
    color: var(--teal, #14b8a6);
}

.header-user-info {
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: .35rem;
}

.header-user-name {
    font-weight: 700;
    color: #0f172a;
    font-size: .9rem;
    line-height: 1.3;
    margin: 0;
}

.header-user-email {
    color: #64748b;
    font-size: .78rem;
    margin: 0;
}

.header-user-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem 1rem;
    border-radius: 8px;
    color: #334155;
    font-size: .85rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background .15s, color .15s;
}

.header-user-item i {
    width: 16px;
    color: #94a3b8;
}

.header-user-item:hover {
    background: var(--teal-wash, #e6fffa);
    color: var(--teal-dark, #0f766e);
}

.header-user-item:hover i {
    color: var(--teal, #14b8a6);
}

.header-user-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.header-user-item.danger:hover i {
    color: #ef4444;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 520px) {
    .am-overlay { padding: .5rem; align-items: flex-start; padding-top: 1rem; }

    .am-card {
        padding: 1.25rem 1.1rem;
        border-radius: 16px;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
    }

    .am-title {
        font-size: 1.2rem;
    }

    .am-field-row {
        grid-template-columns: 1fr;
    }

    .am-row-between {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    /* Input alanlar touch-friendly */
    .am-input-wrap input { min-height: 44px; font-size: 16px; } /* iOS zoom önleme */
    .am-btn, .am-primary-btn { min-height: 46px; }
}

@media (max-width: 380px) {
    .am-card { padding: 1rem .9rem; border-radius: 12px; }
}

/* ── Header — Dil Seçici ──────────────────────────────── */
.header-lang {
    position: relative;
}

.header-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .85rem;
    border-radius: 999px;
    background: transparent;
    color: var(--teal-dark, #0f766e);
    border: 1px solid var(--teal-soft, #99f6e4);
    font-weight: 600;
    font-size: .85rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.header-lang-trigger:hover,
.header-lang:hover .header-lang-trigger {
    background: var(--teal-wash, #e6fffa);
    color: var(--teal-dark, #0f766e);
    border-color: var(--teal, #14b8a6);
}

.header-lang-trigger > i:first-child {
    font-size: .9rem;
    opacity: .85;
}

.header-lang-menu {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 36px -10px rgba(0, 0, 0, .18);
    border: 1px solid #e2e8f0;
    min-width: 180px;
    padding: .35rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s, transform .18s, visibility .18s;
    z-index: 1100;
}

.header-lang-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -.65rem;
    height: .75rem;
    background: transparent;
}

.header-lang:hover .header-lang-menu,
.header-lang.open .header-lang-menu,
.header-lang:focus-within .header-lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-lang-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .7rem;
    border-radius: 8px;
    font-size: .85rem;
    color: #1f2937;
    text-decoration: none;
    transition: background .15s;
}

.header-lang-item:hover {
    background: #f1f5f9;
    color: var(--teal-dark, #0f766e);
}

.header-lang-item.active {
    background: var(--teal-wash, #e6fffa);
    color: var(--teal-dark, #0f766e);
    font-weight: 600;
}

.header-lang-code {
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .5px;
    background: #f1f5f9;
    color: #475569;
    padding: .2rem .45rem;
    border-radius: 6px;
    min-width: 30px;
    text-align: center;
}

.header-lang-item.active .header-lang-code {
    background: var(--teal, #14b8a6);
    color: #fff;
}

.header-lang-name {
    flex: 1;
}

.header-lang-item i {
    font-size: .75rem;
    color: var(--teal, #14b8a6);
}

@media (max-width: 768px) {
    .header-lang { display: none; }
}
