/* =====================================================================
   Arsuz Kültür — auth.css
   Login, register and the "registration received" page.
   Builds on site.css (tokens, buttons, form controls, chip, icon-circle).

   .auth-section > .container > .auth-layout[.auth-layout--login]
       .auth-aside      photo on top, statements on a solid dark panel below it
       .auth-card       heading + form
   .auth-roles          account type as radio cards (.auth-role > input.auth-role-input + label.auth-role-card)
   .auth-field          label + control + .auth-hint
   .auth-password       input group with the show/hide button ([data-password-toggle])
   [data-role-only]     block shown for one account type: business_owner | writer | none
   .auth-done           confirmation page (.auth-steps, .auth-prepare)
   ===================================================================== */

.auth-section { padding: clamp(1.25rem, 4vw, 3rem) 0 clamp(2.5rem, 6vw, 4.5rem); }

/* ── Two columns from lg up; on phones the form comes first ────────── */
.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 68rem;
    margin-inline: auto;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-lg);
    background: #fff;
    box-shadow: var(--ak-shadow-card);
    overflow: hidden;
}
.auth-layout--login { max-width: 58rem; }
.auth-card { order: 1; min-width: 0; padding: clamp(1.25rem, 4.5vw, 2.75rem); }
.auth-aside { order: 2; }
@media (min-width: 992px) {
    .auth-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); box-shadow: var(--ak-shadow-raised); }
    .auth-layout--login { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-card { order: 2; }
    .auth-aside { order: 1; }
}

/* ── Photo panel ───────────────────────────────────────────────────── */
.auth-aside {
    --ak-focus: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: linear-gradient(160deg, #0f3140 0%, var(--ak-primary-dark) 100%);
    color: var(--ak-on-dark);
}
.auth-aside-media { position: relative; flex: 1 1 auto; min-height: 9rem; max-height: 12rem; margin: 0; overflow: hidden; }
.auth-aside-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* The photo fades into the panel below it; the text never sits on the photo itself. */
.auth-aside-media::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 3.5rem;
    background: linear-gradient(180deg, rgba(15, 49, 64, 0), #0f3140);
    pointer-events: none;
}
.auth-aside-place {
    position: absolute;
    top: .7rem;
    left: .8rem;
    z-index: 1;
    margin: 0;
    padding: .15rem .6rem;
    border-radius: var(--ak-radius-pill);
    background: rgba(var(--ak-ink-rgb), .78);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.5;
}
.auth-aside-body { flex: none; padding: 1.1rem clamp(1.25rem, 4.5vw, 2.25rem) 1.6rem; background: #0f3140; }
.auth-aside-eyebrow {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .6rem;
    color: var(--ak-accent);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.auth-aside-eyebrow::before { content: ''; flex: none; width: 1.6rem; height: 2px; border-radius: 2px; background: var(--ak-accent); }
.auth-aside-title {
    margin: 0 0 1rem;
    color: #fff;
    font-family: var(--ak-font-display);
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    text-wrap: balance;
}
.auth-aside-text { margin: 0; color: var(--ak-on-dark); line-height: 1.6; }
.auth-points { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: flex-start; gap: .7rem; color: var(--ak-on-dark); font-weight: 600; line-height: 1.5; }
.auth-points .bi { flex: none; margin-top: .12rem; color: var(--ak-accent); font-size: 1.15rem; line-height: 1.2; }
@media (min-width: 992px) {
    .auth-aside-media { min-height: 14rem; max-height: none; }
    .auth-aside-body { padding-bottom: 2.25rem; }
}
@media (max-width: 991.98px) {
    /* The login form needs no companion panel on a phone. */
    .auth-layout--login .auth-aside { display: none; }
}

/* ── Card ──────────────────────────────────────────────────────────── */
.auth-title { margin: 0 0 .5rem; color: var(--ak-dark); font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 800; line-height: 1.15; }
.auth-lead { margin: 0 0 1.5rem; color: var(--ak-text-light); font-size: 1.02rem; line-height: 1.55; }
.auth-form { display: grid; gap: 1.15rem; }
.auth-form > * { min-width: 0; margin: 0; }
.auth-row { display: grid; gap: 1.15rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 576px) { .auth-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auth-field > .form-label { display: block; }
.auth-form .form-control { min-height: 48px; font-size: 1rem; }
.auth-hint { margin: .4rem 0 0; color: var(--ak-text-light); font-size: .88rem; line-height: 1.5; }

/* Show / hide password */
.auth-password { display: flex; flex-wrap: nowrap; }
.auth-password > .form-control { flex: 1 1 auto; min-width: 0; }
/* .has-toggle is set by the page script when it reveals the button (without JavaScript there is no button). */
.auth-password.has-toggle > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.auth-password > .form-control:focus { position: relative; z-index: 1; }
.auth-password-toggle {
    flex: none;
    min-width: 5.25rem;
    min-height: 48px;
    margin-left: -1px;
    border: 1px solid #c5d5d9;
    border-radius: 0 var(--bs-border-radius, .375rem) var(--bs-border-radius, .375rem) 0;
    background: var(--ak-tint);
    color: var(--ak-primary-dark);
    font-size: .9rem;
    font-weight: 800;
    cursor: pointer;
}
.auth-password-toggle:hover { background: var(--ak-tint-strong); }
.auth-password-toggle:focus-visible { position: relative; z-index: 2; outline-offset: 2px; }
.auth-password-toggle[hidden] { display: none; }

/* ── Account type cards ────────────────────────────────────────────── */
.auth-roles { min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-roles > legend { float: none; width: auto; margin: 0 0 .5rem; padding: 0; font-size: .92rem; font-weight: 800; color: var(--ak-dark); }
.auth-role-grid { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 576px) { .auth-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auth-role { position: relative; display: flex; min-width: 0; }
/* The radio stays in the tab order and reachable by arrow keys; only its box is hidden. */
.auth-role-input { position: absolute; top: 1rem; left: 1rem; width: 1px; height: 1px; margin: 0; opacity: 0; }
.auth-role-card {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: .8rem;
    min-height: 72px;
    padding: .9rem 2.4rem .9rem .95rem;
    border: 2px solid var(--ak-border);
    border-radius: var(--ak-radius);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.auth-role-card:hover { border-color: var(--ak-primary); }
.auth-role-text { display: grid; gap: .15rem; min-width: 0; }
.auth-role-title { color: var(--ak-dark); font-weight: 800; line-height: 1.3; }
.auth-role-desc { color: var(--ak-text-light); font-size: .88rem; line-height: 1.45; }
.auth-role-check { position: absolute; top: .8rem; right: .85rem; color: var(--ak-primary); font-size: 1.15rem; line-height: 1; opacity: 0; }
.auth-role-input:checked + .auth-role-card { border-color: var(--ak-primary); background: var(--ak-tint); box-shadow: 0 0 0 1px var(--ak-primary); }
.auth-role-input:checked + .auth-role-card .auth-role-check { opacity: 1; }
.auth-role-input:checked + .auth-role-card .icon-circle { background: var(--ak-primary); color: #fff; }
.auth-role-input:focus-visible + .auth-role-card { outline: 3px solid var(--ak-focus, var(--ak-primary)); outline-offset: 3px; }

/* ── Blocks for one account type ───────────────────────────────────────
   The checked radio decides (works without JavaScript); the same state is mirrored as a class by the
   page script for browsers that do not know :has(). Without either, every block stays visible. */
.auth-layout:has(#reg-role-business:checked) [data-role-only]:not([data-role-only="business_owner"]),
.auth-layout:has(#reg-role-writer:checked) [data-role-only]:not([data-role-only="writer"]),
.auth-layout:not(:has(.auth-role-input:checked)) [data-role-only]:not([data-role-only="none"]) { display: none; }
.auth-layout.is-role-business_owner [data-role-only]:not([data-role-only="business_owner"]),
.auth-layout.is-role-writer [data-role-only]:not([data-role-only="writer"]),
.auth-layout.is-role-none [data-role-only]:not([data-role-only="none"]) { display: none; }

/* ── Claim hand-off, notices, footer of the card ───────────────────── */
.auth-claim { padding: .85rem 1rem; border: 1px solid #f0d78c; border-radius: var(--ak-radius); background: #fff8e4; }
.auth-claim .chip { white-space: normal; text-align: left; font-size: .9rem; padding: .3rem .8rem; }
.auth-claim .auth-hint { color: #5c4500; }
.auth-notice {
    display: flex;
    gap: .65rem;
    padding: .85rem 1rem;
    border-radius: var(--ak-radius);
    background: var(--ak-tint);
    color: var(--ak-primary-dark);
    font-size: .93rem;
    font-weight: 600;
    line-height: 1.5;
}
.auth-notice > .bi { flex: none; margin-top: .1rem; font-size: 1.05rem; }
.auth-privacy { color: var(--ak-text-light); font-size: .86rem; line-height: 1.5; }
.auth-submit { width: 100%; min-height: 52px; gap: .5rem; font-size: 1.05rem; }
.auth-links { display: grid; gap: 0; margin: 1.5rem 0 0; padding: .75rem 0 0; border-top: 1px solid var(--ak-border); color: var(--ak-text-light); }
.auth-links p { margin: 0; line-height: 1.5; }
.auth-links a { display: inline-block; padding-block: .65rem; font-weight: 800; }
.auth-help { margin: 1rem 0 0; color: var(--ak-text-light); font-size: .9rem; line-height: 1.5; }
.auth-help a { display: inline-block; padding-block: .65rem; font-weight: 700; }

/* ── Confirmation page ─────────────────────────────────────────────── */
.auth-done { max-width: 46rem; margin-inline: auto; }
.auth-done-card {
    padding: clamp(1.25rem, 4.5vw, 2.75rem);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-lg);
    background: #fff;
    box-shadow: var(--ak-shadow-card);
}
.auth-done-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.auth-done-head .icon-circle { margin-top: .15rem; }
.auth-done-head .auth-lead { margin-bottom: 0; }
.auth-done-email { margin: 0 0 1.5rem; padding: .8rem 1rem; border-radius: var(--ak-radius); background: var(--ak-tint); color: var(--ak-primary-dark); line-height: 1.5; }
.auth-done-email strong { display: block; color: var(--ak-dark); font-size: 1.05rem; overflow-wrap: anywhere; }
.auth-done h2 { margin: 1.75rem 0 .9rem; font-family: var(--ak-font-body); font-size: 1.15rem; font-weight: 800; letter-spacing: 0; color: var(--ak-dark); }
.auth-steps { display: grid; gap: .9rem; margin: 0; padding: 0; list-style: none; counter-reset: auth-step; }
.auth-steps li { position: relative; min-height: 2rem; padding-left: 2.85rem; line-height: 1.55; counter-increment: auth-step; }
.auth-steps li::before {
    content: counter(auth-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--ak-primary);
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1;
}
.auth-done-claim { display: flex; gap: .65rem; margin: 1.25rem 0 0; padding: .85rem 1rem; border: 1px solid #f0d78c; border-radius: var(--ak-radius); background: #fff8e4; color: #5c4500; line-height: 1.5; }
.auth-done-claim > .bi { flex: none; margin-top: .15rem; }
.auth-prepare { margin: 1.75rem 0 0; padding: 1.1rem 1.25rem 1.25rem; border-left: 4px solid var(--ak-accent); border-radius: 0 var(--ak-radius) var(--ak-radius) 0; background: var(--ak-sand); }
.auth-prepare h2 { margin-top: 0; }
.auth-prepare ul { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.auth-prepare li { display: flex; align-items: flex-start; gap: .65rem; line-height: 1.5; }
.auth-prepare li .bi { flex: none; margin-top: .15rem; color: var(--ak-accent-ink); }
.auth-done-help { margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--ak-border); line-height: 1.55; }
.auth-done-help a { display: inline-block; padding-block: .65rem; font-weight: 800; }
.auth-done-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
@media (max-width: 575.98px) {
    .auth-done-actions .btn { flex: 1 1 100%; }
    .auth-done-head { flex-direction: column; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-role-card { transition: none; }
}
