/* ============================================================
   AUREON — Shared design system v2
   Pure black canvas / red accents. Used by:
   - /controller/sign-in.php
   - /create/index.php
   - /controller/dashboard.php
   ============================================================ */

:root {
    /* Surfaces — pure black base */
    --au-bg: #000000;
    --au-bg-2: #050506;
    --au-panel: #0a0a0b;
    --au-panel-2: #0e0e10;
    --au-input: #060607;
    --au-border: rgba(255, 255, 255, 0.07);
    --au-border-2: rgba(255, 255, 255, 0.13);
    --au-border-red: rgba(220, 38, 38, 0.35);

    /* Text */
    --au-text: #f4f4f5;
    --au-text-2: #a1a1aa;
    --au-text-3: #8b8b93;
    --au-text-dim: #6b6b73;

    /* Red scale (fixed theme — never switch) */
    --au-red: #dc2626;
    --au-red-hi: #ef4444;
    --au-red-text: #f87171;
    --au-red-deep: #991b1b;
    --au-red-darker: #7f1d1d;
    --au-red-glow: rgba(220, 38, 38, 0.30);
    --au-red-ring: rgba(220, 38, 38, 0.18);
    --au-red-tint: rgba(220, 38, 38, 0.10);

    /* Metal */
    --au-metal: linear-gradient(152deg, #101012 0%, #0a0a0c 38%, #0e0e11 64%, #09090b 100%);
    --au-metal-soft: linear-gradient(160deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.012) 28%, rgba(255,255,255,0) 55%);

    /* Status / brands */
    --au-success: #ef4444;
    --au-discord: #5865F2;
    --au-discord-dark: #4752C4;

    --au-radius: 16px;
    --au-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Backdrop: pure black + restrained red glows ---------- */
.au-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: #000;
}
.au-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(248, 113, 113, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(248, 113, 113, 0.026) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 38%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 75% at 50% 38%, #000 30%, transparent 100%);
}
.au-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 36% 30% at 10% 20%, rgba(220, 38, 38, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 30% 26% at 92% 80%, rgba(220, 38, 38, 0.045) 0%, transparent 70%);
}

/* ---------- Panel (clean flat card) ---------- */
.au-card {
    background: var(--au-panel);
    border: 1px solid var(--au-border);
    border-radius: var(--au-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}
.au-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--au-metal-soft);
    pointer-events: none;
}
.au-card-edge {
    position: absolute;
    top: -1px;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(248, 113, 113, 0.45), transparent);
    pointer-events: none;
}

/* ---------- Wordmark ---------- */
.au-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.au-logo-tile {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(140deg, #ef4444 0%, #b91c1c 60%, #7f1d1d 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 8px 22px rgba(220, 38, 38, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}
.au-logo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.au-wordmark {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.16em;
    color: #fff;
    line-height: 1;
}
.au-wordmark em {
    font-style: normal;
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 55%, #b91c1c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Buttons ---------- */
.au-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 20px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-family: var(--au-font);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.au-btn:focus-visible {
    outline: 2px solid var(--au-red-text);
    outline-offset: 2px;
}
.au-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.au-btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 24px var(--au-red-glow);
}
.au-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 12px 30px rgba(220, 38, 38, 0.42);
}
.au-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.au-btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--au-border);
    color: var(--au-text);
}
.au-btn-ghost:hover:not(:disabled) {
    border-color: var(--au-border-red);
    color: #fff;
    background: var(--au-red-tint);
}

.au-btn-discord {
    background: linear-gradient(135deg, var(--au-discord) 0%, var(--au-discord-dark) 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 24px rgba(88, 101, 242, 0.28);
}
.au-btn-discord:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 30px rgba(88, 101, 242, 0.38);
}

/* ---------- Inputs ---------- */
.au-field {
    width: 100%;
    padding: 13px 14px 13px 42px;
    background: var(--au-input);
    border: 1px solid var(--au-border);
    border-radius: 11px;
    color: var(--au-text);
    font-family: var(--au-font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.au-field::placeholder { color: #52525a; }
.au-field:hover { border-color: var(--au-border-2); }
.au-field:focus {
    border-color: var(--au-red-hi);
    box-shadow: 0 0 0 3px var(--au-red-ring);
    background: #08080a;
}
.au-field-group { position: relative; display: flex; align-items: center; }
.au-field-group > i {
    position: absolute;
    left: 14px;
    color: var(--au-text-dim);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}
.au-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--au-text-2);
    margin-bottom: 8px;
}
.au-field-hint {
    font-size: 11.5px;
    color: var(--au-text-dim);
    margin-top: 7px;
}

/* Validation states */
.au-field.is-invalid { border-color: rgba(239, 68, 68, 0.55); }
.au-field.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }
.au-field.is-valid { border-color: rgba(34, 197, 94, 0.45); }
.au-validation-msg {
    display: none;
    font-size: 11.5px;
    margin-top: 7px;
    align-items: center;
    gap: 5px;
}
.au-validation-msg.show { display: flex; }
.au-validation-msg.err { color: #fca5a5; }
.au-validation-msg.ok { color: #4ade80; }

/* ---------- Stats ---------- */
.au-stat-value {
    font-weight: 900;
    font-size: 46px;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--au-red-text);
    text-shadow: 0 0 32px rgba(220, 38, 38, 0.30);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.au-stat-star {
    font-size: 0.52em;
    color: var(--au-red-hi);
    display: inline-block;
    animation: auStar 2.4s ease-in-out infinite;
}
@keyframes auStar {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.22) rotate(12deg); opacity: 0.75; }
}
.au-stat-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--au-text-dim);
    margin-top: 9px;
}
.au-stat-divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.14), transparent);
}

/* ---------- Links & misc ---------- */
.au-link { color: var(--au-red-text); text-decoration: none; font-weight: 600; }
.au-link:hover { color: #fca5a5; text-decoration: underline; }
.au-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: var(--au-red-tint);
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: var(--au-red-text);
}

/* ---------- SweetAlert2 theme ---------- */
.swal2-popup.au-swal {
    background: var(--au-panel-2);
    border: 1px solid var(--au-border);
    border-radius: 16px;
    color: var(--au-text);
    font-family: var(--au-font);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 80px rgba(0, 0, 0, 0.6);
}
.swal2-popup.au-swal .swal2-title { color: #fff; font-size: 20px; font-weight: 800; }
.swal2-popup.au-swal .swal2-html-container { color: var(--au-text-2); font-size: 14px; }
.swal2-popup.au-swal .swal2-confirm.au-swal-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 10px 22px !important;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}
.swal2-popup.au-swal .swal2-cancel.au-swal-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--au-border-2);
    color: var(--au-text-2) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 10px 22px !important;
}
.au-token-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px auto 4px;
    padding: 10px 12px;
    max-width: 100%;
    background: #060607;
    border: 1px dashed rgba(248, 113, 113, 0.35);
    border-radius: 10px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    color: var(--au-red-text);
    word-break: break-all;
    user-select: all;
    text-align: left;
}
.au-token-copy {
    flex-shrink: 0;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: var(--au-red-text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--au-font);
    transition: background 0.15s ease;
}
.au-token-copy:hover { background: rgba(220, 38, 38, 0.24); color: #fff; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .au-stat-star { animation: none; }
    .au-btn, .au-field { transition: none; }
}
