/* ============================================================
   ÜNİTERCİH 360 — Giriş / Kayıt Modalı (global)
   Palet: beyaz / lacivert / kırmızı / gri — gradyan yok
   ============================================================ */

.authm {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(1rem, 5vh, 4rem) 1rem 2rem;
    overflow-y: auto;
}
.authm[hidden] { display: none; }

.authm__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 36, .62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .25s ease;
}
.authm.is-open .authm__overlay { opacity: 1; }

.authm__dialog {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 30px 70px -20px rgba(15, 20, 36, .55);
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px) scale(.98);
    transition: opacity .25s ease, transform .25s ease;
}
.authm.is-open .authm__dialog { opacity: 1; transform: translateY(0) scale(1); }

/* ---------- Başlık ---------- */
.authm__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem 1.15rem;
    background: var(--brand-800);
    color: #fff;
}
.authm__title { color:white !important; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.authm__desc { margin: .3rem 0 0; font-size: .88rem; color: rgba(226, 232, 244, .82); line-height: 1.4; }
.authm__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background .18s ease;
}
.authm__close:hover { background: var(--accent-500); }
.authm__close .icon { width: 18px; height: 18px; }

/* ---------- Sekmeler ---------- */
.authm__tabs {
    display: flex;
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-200);
}
.authm__tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .95rem .5rem;
    border: 0;
    background: transparent;
    color: var(--ink-500);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: color .18s ease, background .18s ease;
}
.authm__tab .icon { width: 17px; height: 17px; }
.authm__tab::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent-500);
    transform: scaleX(0);
    transition: transform .2s ease;
}
.authm__tab:hover { color: var(--brand-700); }
.authm__tab.is-active { color: var(--brand-700); background: var(--white); }
.authm__tab.is-active::after { transform: scaleX(1); }

/* ---------- Gövde ---------- */
.authm__body { padding: 1.5rem; }
.authm__panel { display: none; }
.authm__panel.is-active { display: block; animation: authm-fade .3s ease; }
@keyframes authm-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Form ---------- */
.authm-form { display: flex; flex-direction: column; gap: 1rem; }
.authm-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }

.authm-field { display: flex; flex-direction: column; gap: .38rem; }
.authm-field__label { font-size: .85rem; font-weight: 700; color: var(--ink-800); }
.authm-field__opt { font-weight: 500; color: var(--ink-400); font-size: .78rem; }
.authm-field__input {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--ink-200);
    border-radius: 11px;
    background: var(--ink-50);
    color: var(--ink-900);
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.authm-field__input::placeholder { color: var(--ink-400); }
.authm-field__input:focus {
    outline: none;
    border-color: var(--brand-400);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(60, 81, 128, .14);
}
.authm-field__select { appearance: none; cursor: pointer; }
.authm-field.is-invalid .authm-field__input { border-color: var(--accent-500); background: var(--accent-50); }

.authm-field__pw { position: relative; display: flex; align-items: center; }
.authm-field__pw .authm-field__input { padding-right: 4.2rem; }
.authm-field__pw-toggle {
    position: absolute;
    right: .5rem;
    border: 0;
    background: transparent;
    color: var(--brand-500);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    padding: .3rem .4rem;
    border-radius: 7px;
}
.authm-field__pw-toggle:hover { background: var(--brand-50); }

.authm-field__error {
    display: none;
    font-size: .8rem;
    color: var(--accent-600);
    font-weight: 600;
}
.authm-field__error.is-visible { display: block; }

/* Genel form uyarısı */
.authm-form__alert {
    margin: 0;
    padding: .7rem .9rem;
    border-radius: 10px;
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    color: var(--accent-600);
    font-size: .88rem;
    font-weight: 600;
}
.authm-form__alert[hidden] { display: none; }

.authm-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.authm-form__link { font-size: .85rem; font-weight: 600; color: var(--brand-500); }
.authm-form__link:hover { color: var(--accent-500); }

.authm-check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .85rem;
    color: var(--ink-600);
    cursor: pointer;
    line-height: 1.4;
}
.authm-check input { margin-top: .15rem; accent-color: var(--brand-600); flex: none; width: 16px; height: 16px; }
.authm-check a { color: var(--brand-600); font-weight: 600; }
.authm-check--terms { margin-top: -.25rem; }

/* Buton yükleniyor durumu */
[data-auth-submit] { position: relative; }
[data-auth-submit].is-loading { color: transparent; pointer-events: none; }
[data-auth-submit].is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authm-spin .6s linear infinite;
}
@keyframes authm-spin { to { transform: rotate(360deg); } }

.authm__switch {
    margin: 1.15rem 0 0;
    text-align: center;
    font-size: .88rem;
    color: var(--ink-500);
}
.authm__switch-btn {
    border: 0;
    background: transparent;
    color: var(--brand-600);
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    padding: 0 .1rem;
}
.authm__switch-btn:hover { color: var(--accent-500); text-decoration: underline; }

/* Body kilidi (modal açıkken arka plan kaymaz) */
body.authm-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .authm__overlay, .authm__dialog { transition: none; }
    .authm__panel.is-active { animation: none; }
    [data-auth-submit].is-loading::after { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
    .authm { padding: 0; align-items: stretch; }
    .authm__dialog {
        max-width: none;
        min-height: 100%;
        border-radius: 0;
    }
    .authm-form__grid { grid-template-columns: 1fr; }
}
