/* ==========================================================================
   Auth pages: login-form.php (log in / create account / reset, Customer + Vendor),
   verify-otp.php, reset-password.php. Plain cream page background like the rest of
   the site (client feedback S16 r12), no title banner (A12 r26).
   ========================================================================== */

.ek-auth { background: var(--ek-cream); min-height: 70vh; }
.ek-auth__wrap { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 4.5vw, 64px) clamp(16px, 3vw, 32px) clamp(48px, 6vw, 88px); }
.ek-auth__wrap--narrow { max-width: 560px; }

.ek-auth__card {
    display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    background: var(--ek-paper); border: 1px solid var(--ek-line); border-radius: 24px;
    box-shadow: var(--ek-shadow); overflow: hidden;
}
.ek-auth__card--single { grid-template-columns: minmax(0, 1fr); }

/* photo column */
.ek-auth__media { position: relative; margin: 10px 0 10px 10px; border-radius: 18px; overflow: hidden; background: var(--ek-sand); min-height: 560px; }
.ek-auth__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: opacity .6s var(--ek-ease), transform 1.4s var(--ek-ease); }
.ek-auth__img--vendor { opacity: 0; transform: scale(1.03); }
.ek-auth[data-role="vendor"] .ek-auth__img--vendor { opacity: 1; transform: none; }
.ek-auth[data-role="vendor"] .ek-auth__img--customer { opacity: 0; transform: scale(1.03); }
.ek-auth__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(51, 34, 25, 0) 58%, rgba(51, 34, 25, .62) 100%); pointer-events: none; }
.ek-auth__caption {
    position: absolute; left: 22px; right: 22px; bottom: 20px; z-index: 1; margin: 0;
    color: var(--ek-on-dark); font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; line-height: 1.6;
}

/* form column */
.ek-auth__panel { padding: clamp(24px, 4vw, 52px) clamp(20px, 4.2vw, 56px); min-width: 0; align-self: start; }
.ek-auth__roles {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 clamp(22px, 3vw, 30px);
    border-radius: 999px; background: var(--ek-sand); border: 1px solid var(--ek-line);
}
.ek-auth__role {
    display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px;
    color: var(--ek-ink); text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    transition: background-color .25s var(--ek-ease), color .25s var(--ek-ease), box-shadow .25s;
}
.ek-auth__role:hover { color: var(--ek-maroon); background: rgba(251, 248, 242, .7); }
.ek-auth__role[aria-current] { background: var(--ek-maroon); color: var(--ek-on-dark); box-shadow: 0 6px 16px rgba(112, 28, 28, .22); }
.ek-auth__role[aria-current]:hover { background: var(--ek-brown); color: var(--ek-on-dark); }

.ek-auth__section { padding: 0; }
.ek-auth__section[hidden] { display: none; }
.ek-auth .ek-field { align-content: start; }
.ek-auth__section:not([hidden]) { animation: ek-fade .35s var(--ek-ease); }
.ek-auth__title { margin: 0 0 6px; font-size: clamp(24px, 2.6vw, 30px); font-weight: 700; line-height: 1.15; color: var(--ek-ink); letter-spacing: -.005em; }
.ek-auth__lead { margin: 0 0 22px; font-size: 14.5px; line-height: 1.6; color: var(--ek-ink-soft); }
.ek-auth__lead strong { color: var(--ek-ink); }
.ek-auth__form { display: grid; gap: 2px; }
.ek-auth__form .ek-btn--block { width: 100%; margin-top: 8px; min-height: 50px; }
.ek-auth__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.ek-auth__grid--place { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.ek-auth__group { margin: 10px 0 10px; padding-top: 12px; border-top: 1px solid var(--ek-line); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ek-maroon); }
.ek-auth__form > .ek-auth__group:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.ek-auth__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ek-auth__label-row label { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ek-ink); }
.ek-auth__small { font-size: 13px; color: var(--ek-maroon); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; padding: 6px 0; }
.ek-auth__small:hover { color: var(--ek-brown); }
.ek-auth .ek-field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234f3017' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.ek-auth .ek-field input, .ek-auth .ek-field select, .ek-auth .ek-field textarea { min-height: 48px; }
.ek-auth .ek-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.ek-auth .ek-field input::placeholder, .ek-auth .ek-field textarea::placeholder { color: rgba(79, 48, 23, .45); }
.ek-auth .ek-field.has-error input, .ek-auth .ek-field.has-error select, .ek-auth .ek-field.has-error textarea { border-color: var(--ek-maroon); background: #fbf1ee; }
.ek-field__error { font-size: 12.5px; color: var(--ek-maroon); font-weight: 600; }
.ek-auth .ek-help { font-size: 12.5px; color: var(--ek-ink-soft); }

/* password with show/hide */
.ek-pw { position: relative; }
.ek-pw input { padding-right: 52px !important; }
.ek-pw__toggle {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
    border: 0; background: transparent; border-radius: 10px; color: var(--ek-ink-soft); font-size: 18px; display: grid; place-items: center; cursor: pointer;
}
.ek-pw__toggle:hover, .ek-pw__toggle[aria-pressed="true"] { color: var(--ek-maroon); }
.ek-pw__toggle:focus-visible { outline: 2px solid var(--ek-nude); outline-offset: -2px; }

/* checkbox */
.ek-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; margin: 8px 0 4px; font-size: 14px; line-height: 1.5; color: var(--ek-ink); cursor: pointer; }
.ek-check input {
    appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 1.5px solid rgba(79, 48, 23, .4);
    background: var(--ek-paper); display: grid; place-items: center; cursor: pointer; transition: background-color .2s, border-color .2s;
}
.ek-check input::after { content: ""; width: 6px; height: 11px; border: solid var(--ek-on-dark); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
.ek-check input:checked { background: var(--ek-maroon); border-color: var(--ek-maroon); }
.ek-check input:checked::after { opacity: 1; }
.ek-check input:focus-visible { outline: 2px solid var(--ek-nude); outline-offset: 2px; }
.ek-check.has-error input { border-color: var(--ek-maroon); }
.ek-check a { color: var(--ek-maroon); text-underline-offset: 3px; }
.ek-check a:hover { color: var(--ek-brown); }

.ek-auth__alt { margin: 18px 0 0; font-size: 14px; color: var(--ek-ink-soft); text-align: center; }
.ek-auth__alt + .ek-auth__alt { margin-top: 6px; }
.ek-auth__alt a { color: var(--ek-maroon); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.ek-auth__alt a:hover { color: var(--ek-brown); }
.ek-auth__help { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--ek-line); font-size: 13px; color: var(--ek-ink-soft); text-align: center; }
.ek-auth__help a { color: var(--ek-ink); text-underline-offset: 3px; overflow-wrap: anywhere; }
.ek-auth__help a:hover { color: var(--ek-maroon); }
.ek-auth__note { margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; background: var(--ek-sand); font-size: 13.5px; line-height: 1.55; }
.ek-auth__note a { color: var(--ek-maroon); font-weight: 700; }
.ek-auth__flash:empty { display: none; }
.ek-auth__flash .ek-alert { margin-bottom: 18px; }

/* honeypot (bots only) */
.ek-auth__hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* vendor application steps */
.ek-auth__progress { list-style: none; margin: -6px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: ekstep; }
.ek-auth__progress li {
    counter-increment: ekstep; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 2px solid var(--ek-line);
    font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ek-ink-soft);
}
.ek-auth__progress li::before {
    content: counter(ekstep); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    font-size: 11px; letter-spacing: 0; background: var(--ek-sand); color: var(--ek-ink-soft);
}
.ek-auth__progress li.is-done, .ek-auth__progress li.is-current { color: var(--ek-ink); border-top-color: var(--ek-maroon); }
.ek-auth__progress li.is-done::before { content: "✓"; background: var(--ek-maroon); color: var(--ek-on-dark); }
.ek-auth__progress li.is-current::before { background: var(--ek-maroon); color: var(--ek-on-dark); }

/* verify / reset */
.ek-auth__icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ek-sand); color: var(--ek-maroon); font-size: 24px; margin: 0 0 16px; }
.ek-otp { text-align: center; font-size: 26px !important; font-weight: 700; letter-spacing: .5em; padding-left: calc(14px + .5em) !important; font-variant-numeric: tabular-nums; }
.ek-otp:disabled { opacity: .55; }
.ek-auth__resend { margin: 18px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 6px; font-size: 14px; color: var(--ek-ink-soft); text-align: center; }
.ek-auth__textbtn {
    border: 0; background: none; padding: 0 2px; min-height: 44px; color: var(--ek-maroon); font-weight: 700; font-size: 14px;
    text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer;
}
.ek-auth__textbtn:hover { color: var(--ek-brown); }
.ek-auth__textbtn:disabled { color: var(--ek-ink-soft); text-decoration: none; cursor: default; }
.ek-btn[disabled] { cursor: not-allowed; }

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .ek-auth__card { grid-template-columns: minmax(0, 1fr); max-width: 620px; margin: 0 auto; }
    .ek-auth__media { display: none; }
}
@media (max-width: 575.98px) {
    .ek-auth__wrap { padding-top: 18px; }
    .ek-auth__card { border-radius: 20px; }
    .ek-auth__panel { padding: 22px 18px 26px; }
    .ek-auth__grid, .ek-auth__grid--place { grid-template-columns: minmax(0, 1fr); }
    .ek-auth__progress li { font-size: 10.5px; letter-spacing: .04em; flex-direction: column; align-items: flex-start; gap: 6px; }
    .ek-otp { font-size: 22px !important; letter-spacing: .35em; }
}
@media (prefers-reduced-motion: reduce) {
    .ek-auth__img { transition: none; }
    .ek-auth__section:not([hidden]) { animation: none; }
}
