/* ═══════════════════════════════════════════════════════════════════
   AUTH PAGE — Prentzas FM
   Modern, Human-Crafted Design System
═══════════════════════════════════════════════════════════════════ */

.auth-page .page-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - var(--header-height, 84px));
    padding-block: clamp(24px, 5vw, 56px);
    width: 100%;
    margin-inline: auto;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: authRise 0.40s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Station identity mark ─────────────────────────────────────── */
.auth-mark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.20);
    color: #fca5a5;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    user-select: none;
}

.auth-mark__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
}

/* ── Card ──────────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #121215;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 16px 40px rgba(0, 0, 0, 0.40);
    padding: clamp(24px, 4vw, 36px);
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.35) 50%, transparent);
    pointer-events: none;
}

.auth-card > * { position: relative; z-index: 1; }

/* ── Tabs ──────────────────────────────────────────────────────── */
.auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    margin-bottom: 24px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.auth-tabs__ink {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    border-radius: 7px;
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 0;
}

.auth-tabs.is-register .auth-tabs__ink { transform: translateX(100%); }

.auth-tab-btn {
    position: relative;
    z-index: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: #a1a1aa;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 9px 14px;
    border-radius: 7px;
    cursor: pointer;
    transition: color 0.16s ease;
    touch-action: manipulation;
    white-space: nowrap;
}

.auth-tab-btn:hover     { color: #f4f4f5; }
.auth-tab-btn.is-active { color: #ffffff; }
.auth-tab-btn:focus-visible { outline: 2px solid #ef4444; outline-offset: 2px; }

/* ── Lockout banner ────────────────────────────────────────────── */
.auth-lockout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #fecaca;
    font-size: 0.86rem;
    line-height: 1.5;
    margin-bottom: 18px;
}
.auth-lockout__icon { font-size: 1.1rem; line-height: 1.4; flex-shrink: 0; }

/* ── Alerts ────────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.5;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.auth-alert__ico { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }
.auth-alert__body { flex: 1; min-width: 0; }
.auth-alert__body ul { margin: 4px 0 0; padding-left: 16px; }
.auth-alert__body li + li { margin-top: 2px; }
.auth-alert--ok  { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.24); color: #d1fae5; }
.auth-alert--err { background: rgba(239, 68, 68, 0.08);  border-color: rgba(239, 68, 68, 0.24);  color: #fee2e2; }

/* ── Remember Me server-side confirmation toast ────────────────── */
.auth-remember-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.4;
    margin-bottom: 18px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.24);
    color: #d1fae5;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-remember-toast svg { flex-shrink: 0; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel header ──────────────────────────────────────────────── */
.auth-title {
    margin: 0 0 4px;
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: clamp(1.65rem, 4vw, 2.1rem);
    line-height: 1.0;
    letter-spacing: 0.03em;
    color: #ffffff;
}
.auth-sub {
    margin: 0 0 22px;
    color: #a1a1aa;
    font-size: 0.86rem;
    line-height: 1.55;
}

/* ── Field layout ──────────────────────────────────────────────── */
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.auth-field label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #f4f4f5;
    cursor: pointer;
}

.auth-opt { font-weight: 400; font-size: 0.74rem; color: #71717a; }

/* ── Inputs ────────────────────────────────────────────────────── */
.auth-input {
    width: 100%;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f4f4f5;
    font-family: inherit;
    font-size: 0.90rem;
    padding: 10px 14px;
    min-height: 44px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input::placeholder { color: #52525b; }
.auth-input:hover  { border-color: rgba(255, 255, 255, 0.15); }
.auth-input:focus  { border-color: rgba(239, 68, 68, 0.55); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); background: #1c1c20; }
.auth-input:disabled { opacity: 0.40; cursor: not-allowed; pointer-events: none; }
.auth-input.is-match    { border-color: rgba(16, 185, 129, 0.55) !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10) !important; }
.auth-input.is-mismatch { border-color: rgba(239, 68, 68, 0.55)  !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10)  !important; }

/* ── Password eye ──────────────────────────────────────────────── */
.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 44px; }

.auth-eye {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    color: #71717a;
    cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease;
    touch-action: manipulation;
}
.auth-eye:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }
.auth-eye.is-on { color: #ef4444; }
.auth-eye:focus-visible { outline: 2px solid #ef4444; outline-offset: 2px; }

/* ── Password strength ─────────────────────────────────────────── */
.auth-strength { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.auth-strength__bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.auth-strength__bar {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.25s ease;
}
.auth-strength__bar.sc1 { background: #ef4444; }
.auth-strength__bar.sc2 { background: #f97316; }
.auth-strength__bar.sc3 { background: #f59e0b; }
.auth-strength__bar.sc4 { background: #10b981; }
.auth-strength__label { font-size: 0.74rem; color: #a1a1aa; min-height: 1em; }

/* ── Custom checkbox ───────────────────────────────────────────── */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
    user-select: none;
}

.auth-check:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

.auth-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.auth-check__box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.16s ease, background 0.16s ease;
    margin-top: 1px;
}

.auth-check__box svg {
    width: 11px;
    height: 11px;
    stroke: #ffffff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.14s ease, transform 0.16s ease;
}

.auth-check.is-checked {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.05);
}

.auth-check.is-checked .auth-check__box {
    background: #dc2626;
    border-color: #dc2626;
}

.auth-check.is-checked .auth-check__box svg {
    opacity: 1;
    transform: scale(1);
}

.auth-check:focus-within .auth-check__box {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.auth-check__text {
    color: #a1a1aa;
    font-size: 0.84rem;
    line-height: 1.45;
    transition: color 0.16s ease;
}

.auth-check.is-checked .auth-check__text {
    color: #f4f4f5;
}

/* ── Remember Me row ───────────────────────────────────────────── */
.auth-remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-remember-row .auth-check {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.auth-remember-hint {
    font-size: 0.74rem;
    font-weight: 500;
    color: #71717a;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.auth-remember-row.is-active .auth-remember-hint {
    color: #34d399;
}

/* ── Submit ────────────────────────────────────────────────────── */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    background: #dc2626;
    color: #ffffff;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.90rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
    touch-action: manipulation;
}
.auth-submit:hover   { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.auth-submit:active  { transform: translateY(0); filter: brightness(0.96); }
.auth-submit:disabled { opacity: 0.40; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.auth-submit:focus-visible { outline: 2px solid #ef4444; outline-offset: 3px; }
.auth-submit svg { flex-shrink: 0; transition: transform 0.18s ease; }
.auth-submit:hover svg { transform: translateX(3px); }

/* ── Prentzas ID Single Sign-On ────────────────────────────────── */
.auth-oidc-wrap {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.auth-btn-prentzas-id {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 12px 18px;
    min-height: 48px;
    border-radius: 10px;
    background: #102344;
    border: 1px solid #315A9B;
    color: #FFFFFF;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: none;
    background-image: none;
    filter: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.auth-btn-prentzas-id:hover {
    background: #17315A;
    border-color: #4B79BF;
    color: #FFFFFF;
    box-shadow: none;
    transform: none;
}

.auth-btn-prentzas-id:focus-visible {
    outline: 2px solid #4B79BF;
    outline-offset: 2px;
    box-shadow: none;
}

.auth-btn-prentzas-id:active {
    background: #0C1B36;
    border-color: #315A9B;
    box-shadow: none;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .auth-btn-prentzas-id {
        transition: none;
    }
}

.auth-btn-prentzas-id__icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    background: none;
    border: none;
    box-shadow: none;
    filter: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.auth-btn-prentzas-id__text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.01em;
    line-height: 1;
}

.auth-oidc-info {
    font-size: 0.78rem;
    color: #a1a1aa;
}

.auth-oidc-link {
    color: #a1a1aa;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
    transition: color 150ms ease, border-color 150ms ease;
}

.auth-oidc-link:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

.auth-divider {
    width: 100%;
    display: flex;
    align-items: center;
    text-align: center;
    margin-top: 6px;
    color: #71717a;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    padding: 0 12px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.auth-foot {
    text-align: center;
    color: #71717a;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .auth-page .page-wrap { padding-block: 16px 32px; }
    .auth-card  { border-radius: 12px; padding: clamp(18px, 4vw, 24px); }
    .auth-shell { max-width: 100%; gap: 12px; }
    .auth-row   { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 420px) {
    .auth-card    { border-radius: 10px; padding: 16px; }
    .auth-title   { font-size: 1.55rem; }
    .auth-remember-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell, .auth-mark__dot, .auth-input,
    .auth-submit, .auth-strength__bar, .auth-tabs__ink,
    .auth-check__box, .auth-check__box svg,
    .auth-remember-toast {
        animation: none !important;
        transition: none !important;
    }
}
