/*
 * auth.css  v2  — AxonEdge Academy
 * ─────────────────────────────────────────────────────────────────────────────
 * Global stylesheet for: Login, ForgotPassword, ResetPassword, Logout,
 *                         NotFound, NotAuthorized pages.
 *
 * All selectors are prefixed with .ax- to prevent any collision with the
 * admin panel styles (.sidebar, .main-wrapper, etc.).
 * This file is loaded globally in index.html — it does NOT use Blazor scoping.
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ═══════════════════════════════════════════════════════════
   AUTH WRAPPER — full viewport centering
═══════════════════════════════════════════════════════════ */

.ax-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #f8fafc;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #1e293b;
}

/* ═══════════════════════════════════════════════════════════
   AUTH CARD — two-column split
═══════════════════════════════════════════════════════════ */

.ax-auth-card {
    width: 100%;
    max-width: 1040px;
    min-height: 620px;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 60px -12px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
}

.ax-auth-card--narrow { max-width: 900px; }

/* ═══════════════════════════════════════════════════════════
   LEFT INFO PANEL  (dark #0b0f1a)
═══════════════════════════════════════════════════════════ */

.ax-info-panel {
    flex: 1.1;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #0b0f1a;
    color: #ffffff;
    overflow: hidden;
}

.ax-info-panel::after {
    content: "";
    position: absolute;
    bottom: -60px; right: -60px;
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* Brand */
.ax-brand-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 48px; z-index: 2;
}
.ax-brand-logo {
    width: 42px; height: 42px;
    background: #6366f1; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
    box-shadow: 0 8px 20px rgba(99,102,241,0.35);
    flex-shrink: 0;
}
.ax-brand-name {
    font-family: 'Syne', sans-serif;
    font-size: 1.45rem; color: #f1f5f9; letter-spacing: -0.3px;
}
.ax-brand-name strong { color: #a5b4fc; }

/* Info body */
.ax-info-body { z-index: 2; flex: 1; }
.ax-info-body h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2.3rem; font-weight: 800; line-height: 1.12;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ax-info-body p {
    color: #94a3b8; font-size: 0.97rem; line-height: 1.65; margin-bottom: 36px;
}

/* Feature items */
.ax-feature-item {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 18px; color: #cbd5e1; font-size: 0.92rem;
}
.ax-feature-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #818cf8; font-size: 14px; flex-shrink: 0;
}

/* Info panel footer */
.ax-info-footer {
    z-index: 2;
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 20px; margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.07);
    color: #475569; font-size: 0.8rem;
}
.ax-social-links { display: flex; gap: 12px; }
.ax-social-links a { color: #475569; font-size: 1rem; text-decoration: none; transition: color 0.2s; }
.ax-social-links a:hover { color: #818cf8; }

/* ═══════════════════════════════════════════════════════════
   RIGHT FORM PANEL
═══════════════════════════════════════════════════════════ */

.ax-form-panel {
    flex: 1;
    padding: 52px 48px;
    display: flex; flex-direction: column; justify-content: center;
    background: #fff;
}

/* Form header */
.ax-form-header { margin-bottom: 28px; }
.ax-form-header h2 {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: 1.75rem; color: #1e293b; margin-bottom: 4px; letter-spacing: -0.4px;
}
.ax-form-header p { color: #64748b; font-size: 0.88rem; }

/* Alert */
.ax-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 500; margin-bottom: 20px; line-height: 1.5;
}
.ax-alert-danger {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    color: #dc2626;
}
.ax-alert i { margin-top: 2px; flex-shrink: 0; }

/* Form groups */
.ax-form-group { margin-bottom: 20px; }
.ax-form-label {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: #475569; margin-bottom: 7px; letter-spacing: 0.2px;
}
.ax-label-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 7px;
}
.ax-forgot-link {
    font-size: 0.82rem; font-weight: 600; color: #6366f1;
    text-decoration: none; transition: color 0.2s;
}
.ax-forgot-link:hover { color: #4f46e5; text-decoration: underline; }

/* Input group */
.ax-input-group { position: relative; display: flex; align-items: center; }
.ax-input-icon {
    position: absolute; left: 14px;
    color: #94a3b8; font-size: 15px;
    pointer-events: none; z-index: 2;
    display: flex; align-items: center;
}
.ax-form-control {
    width: 100%;
    padding: 11px 14px 11px 42px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 10px; font-size: 0.93rem;
    font-family: 'DM Sans', sans-serif; color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none; appearance: none;
}
.ax-form-control:focus {
    border-color: #6366f1; background: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.ax-form-control::placeholder { color: #cbd5e1; }
.ax-form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 36px;
}

/* Password eye toggle */
.ax-input-eye {
    position: absolute; right: 12px;
    background: none; border: none; color: #94a3b8;
    font-size: 15px; cursor: pointer; padding: 4px;
    display: flex; align-items: center; transition: color 0.2s; z-index: 2;
}
.ax-input-eye:hover { color: #6366f1; }

/* Validation message */
.ax-validation {
    display: block; font-size: 12px; color: #ef4444;
    margin-top: 5px; font-weight: 500;
}

/* ── Captcha ── */
.ax-captcha-hint {
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; color: #818cf8;
    background: rgba(99,102,241,0.08); border-radius: 4px;
    padding: 2px 6px; margin-left: 6px; vertical-align: middle;
}
.ax-captcha-row {
    display: flex; align-items: center; gap: 10px;
}
.ax-captcha-box {
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    overflow: hidden; background: #f8fafc; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    height: 52px;
}
.ax-captcha-box canvas { display: block; }
.ax-btn-refresh {
    width: 52px; height: 52px; flex-shrink: 0;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    background: #f8fafc; color: #64748b; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.ax-btn-refresh:hover {
    background: #fff; border-color: #6366f1; color: #6366f1;
    transform: rotate(90deg);
}
.ax-captcha-input {
    flex: 1;
    letter-spacing: 4px; font-weight: 700;
    font-family: "Courier New", Courier, monospace !important;
    text-transform:none;
}

/* ── Primary button ── */
.ax-btn-primary {
    width: 100%; padding: 13px;
    background: #6366f1; color: #fff;
    border: none; border-radius: 10px;
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 4px; text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.ax-btn-primary:hover:not(:disabled) {
    background: #4f46e5; transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99,102,241,0.3); color: #fff;
}
.ax-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

/* Ghost button */
.ax-btn-ghost {
    width: 100%; padding: 11px;
    background: transparent; color: #64748b;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 7px; margin-top: 10px; text-decoration: none; transition: all 0.2s;
}
.ax-btn-ghost:hover { background: #f8fafc; border-color: #6366f1; color: #6366f1; }

/* Spinner */
.ax-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff; border-radius: 50%;
    animation: ax-spin 0.7s linear infinite; flex-shrink: 0; display: inline-block;
}
/* Dark spinner for light backgrounds (logout page) */
.ax-spinner--dark {
    border-color: rgba(99,102,241,0.2);
    border-top-color: #6366f1;
}

@keyframes ax-spin { to { transform: rotate(360deg); } }

/* Form footer */
.ax-form-footer {
    text-align: center; margin-top: 24px; padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}
.ax-form-footer p { font-size: 0.85rem; color: #94a3b8; margin: 0; }
.ax-form-footer a { color: #6366f1; font-weight: 600; text-decoration: none; transition: color 0.2s; }
.ax-form-footer a:hover { color: #4f46e5; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   SUCCESS / ERROR STATE
═══════════════════════════════════════════════════════════ */

.ax-success-state {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 10px 0; gap: 14px;
}
.ax-success-icon {
    width: 80px; height: 80px;
    background: rgba(16,185,129,0.1);
    border: 2px solid rgba(16,185,129,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: #10b981; margin-bottom: 8px;
}
.ax-success-icon--danger {
    background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #ef4444;
}
.ax-success-state h3 {
    font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800;
    color: #1e293b; margin: 0;
}
.ax-success-state p { color: #64748b; font-size: 0.9rem; line-height: 1.6; max-width: 320px; margin: 0; }

/* Info note */
.ax-info-note {
    background: rgba(6,182,212,0.07); border: 1px solid rgba(6,182,212,0.2);
    border-radius: 10px; padding: 12px 16px;
    font-size: 12.5px; color: #0891b2;
    display: flex; align-items: center; gap: 8px;
    font-weight: 500; width: 100%; text-align: left;
}
.ax-info-note--danger { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); color: #dc2626; }
.ax-info-note--small { font-size: 12px; }
.ax-info-note a { color: inherit; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   PASSWORD STRENGTH METER
═══════════════════════════════════════════════════════════ */

.ax-strength-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ax-strength-track {
    flex: 1; height: 5px; background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.ax-strength-fill {
    height: 100%; border-radius: 99px;
    transition: width 0.35s ease, background 0.35s ease;
}
.ax-strength-fill.ax-strength-none   { background: transparent; }
.ax-strength-fill.ax-strength-weak   { background: #ef4444; }
.ax-strength-fill.ax-strength-fair   { background: #f59e0b; }
.ax-strength-fill.ax-strength-strong { background: #06b6d4; }
.ax-strength-fill.ax-strength-great  { background: #10b981; }
.ax-strength-label { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ax-strength-label-weak   { color: #ef4444; }
.ax-strength-label-fair   { color: #f59e0b; }
.ax-strength-label-strong { color: #06b6d4; }
.ax-strength-label-great  { color: #10b981; }

/* Rules checklist */
.ax-rules-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 22px; }
.ax-rule { font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 6px; transition: color 0.2s; }
.ax-rule i { font-size: 13px; }
.ax-rule--pass { color: #10b981; }

/* ═══════════════════════════════════════════════════════════
   ERROR PAGES (404 / 403)
═══════════════════════════════════════════════════════════ */

.ax-error-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; background: #f8fafc;
    font-family: 'DM Sans', sans-serif;
}

.ax-error-card {
    max-width: 520px; width: 100%; text-align: center;
    background: #fff; border-radius: 20px;
    padding: 56px 40px 44px;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.1);
    position: relative; overflow: hidden;
}

.ax-error-glow {
    position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
    width: 300px; height: 300px; border-radius: 50%;
    filter: blur(80px); opacity: 0.25; pointer-events: none;
}
.ax-error-glow--accent  { background: #6366f1; }
.ax-error-glow--danger  { background: #ef4444; }

.ax-error-code {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(5rem, 15vw, 8rem);
    line-height: 1; letter-spacing: -4px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 8px;
}
.ax-error-code--danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ax-error-icon-wrap {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(99,102,241,0.1); border: 2px solid rgba(99,102,241,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #6366f1;
    margin: 0 auto 20px;
}
.ax-error-icon-wrap--danger {
    background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #ef4444;
}

.ax-error-title {
    font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.8rem;
    color: #1e293b; margin-bottom: 12px;
}
.ax-error-desc {
    color: #64748b; font-size: 0.95rem; line-height: 1.65;
    max-width: 380px; margin: 0 auto 28px;
}

.ax-error-actions { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }

.ax-error-footer {
    margin-top: 28px; padding-top: 18px;
    border-top: 1px solid #f1f5f9;
    display: flex; justify-content: center; gap: 10px;
    font-size: 12px; color: #94a3b8;
}
.ax-error-footer a { color: #6366f1; text-decoration: none; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════════════════════════ */

@media (max-width: 991px) {
    .ax-auth-wrapper { padding: 16px; align-items: flex-start; }
    .ax-auth-card { flex-direction: column; min-height: auto; border-radius: 16px; }
    /* Form on top, info below on mobile */
    .ax-info-panel { order: 2; padding: 36px 28px; flex: none; }
    .ax-form-panel { order: 1; padding: 36px 28px; }
    .ax-info-body h1 { font-size: 1.7rem; }
    .ax-brand-header { margin-bottom: 32px; }
    .ax-rules-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ax-form-panel, .ax-info-panel { padding: 28px 20px; }
    .ax-info-body h1 { font-size: 1.5rem; }
    .ax-captcha-row { flex-wrap: wrap; }
    .ax-captcha-input { min-width: 100%; }
    .ax-error-card { padding: 40px 24px 32px; }
}

/* ═══════════════════════════════════════════════════════════
   PAGE LOADER (index.html)
═══════════════════════════════════════════════════════════ */

.page-loader {
    position: fixed; inset: 0; z-index: 9999;
    background: #fff;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.page-loader.active { display: flex; }

.bg-circle  { fill: none; stroke: #f1f5f9; stroke-width: 8; }
.progress-circle {
    fill: none; stroke: #6366f1; stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg); transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.3s ease;
}
