/*
 * Hypnos — Authelia branding override
 * Premium dark trading terminal aesthetic.
 * Palette: #0d1117 bg, #161b22 surface, #30363d border,
 *          #d6a33c gold accent, #e6edf3 text, #8b949e muted.
 */

/* ── Global font ─────────────────────────────────────────────────── */
* {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter',
                 Roboto, Helvetica, Arial, sans-serif !important;
}

/* ── Logo: large + centred ───────────────────────────────────────── */
header img,
img[src*="logo"],
div[class*="Logo"] img,
div[class*="Brand"] img,
img[alt="Logo"] {
    max-width: 380px !important;
    width: 380px !important;
    height: auto !important;
    margin: 40px auto 16px auto !important;
    display: block !important;
    filter: drop-shadow(0 0 40px rgba(214, 163, 60, 0.12));
}

/* Hide the default "Authelia" title — logo says it all */
h1[class*="Title"],
div[class*="Title"],
header h1 {
    font-size: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ── Page background ─────────────────────────────────────────────── */
body,
html,
#root {
    background-color: #0d1117 !important;
    /* Subtle radial glow behind the card */
    background-image: radial-gradient(
        ellipse 60% 50% at 50% 30%,
        rgba(214, 163, 60, 0.04) 0%,
        transparent 70%
    ) !important;
    min-height: 100vh;
}

/* ── Login card ──────────────────────────────────────────────────── */
.MuiPaper-root,
.MuiCard-root,
.MuiPaper-root.MuiPaper-elevation1,
div[class*="LoginPortal"] > div {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 16px !important;
    box-shadow:
        0 0 0 1px rgba(48, 54, 61, 0.5),
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(214, 163, 60, 0.03) !important;
    padding: 32px !important;
    max-width: 420px !important;
    margin: 0 auto !important;
}

/* ── Typography ──────────────────────────────────────────────────── */
body,
.MuiTypography-root,
.MuiInputBase-input,
label, p, span,
h1, h2, h3, h4, h5, h6 {
    color: #e6edf3 !important;
}

.MuiTypography-subtitle1,
.MuiTypography-body2 {
    color: #8b949e !important;
}

/* ── Input fields ────────────────────────────────────────────────── */
.MuiOutlinedInput-root,
.MuiInputBase-root {
    background-color: #0d1117 !important;
    border-radius: 10px !important;
}

.MuiInputBase-input {
    padding: 14px 16px !important;
    font-size: 15px !important;
    letter-spacing: 0.02em !important;
}

.MuiOutlinedInput-notchedOutline {
    border-color: #30363d !important;
    border-width: 1.5px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
    border-color: #484f58 !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
    border-color: #d6a33c !important;
    box-shadow: 0 0 0 3px rgba(214, 163, 60, 0.15) !important;
}

/* ── Labels ───────────────────────────────────────────────────────── */
.MuiInputLabel-root {
    color: #8b949e !important;
    font-size: 13px !important;
    letter-spacing: 0.04em !important;
}
.MuiInputLabel-root.Mui-focused {
    color: #d6a33c !important;
}

/* ── Primary button — gold gradient ──────────────────────────────── */
.MuiButton-containedPrimary,
button[type="submit"] {
    background: linear-gradient(135deg, #e5b96a 0%, #d6a33c 40%, #b7862a 100%) !important;
    color: #0d1117 !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: 0.06em !important;
    border-radius: 10px !important;
    text-transform: none !important;
    padding: 12px 24px !important;
    box-shadow: 0 4px 16px rgba(214, 163, 60, 0.25) !important;
    transition: all 0.25s ease !important;
}

.MuiButton-containedPrimary:hover,
button[type="submit"]:hover {
    background: linear-gradient(135deg, #d6a33c 0%, #b7862a 100%) !important;
    box-shadow: 0 6px 24px rgba(214, 163, 60, 0.4) !important;
    transform: translateY(-1px) !important;
}

.MuiButton-containedPrimary:active,
button[type="submit"]:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(214, 163, 60, 0.3) !important;
}

/* ── Secondary / text buttons ────────────────────────────────────── */
.MuiButton-text,
.MuiButton-outlined {
    color: #8b949e !important;
    font-size: 13px !important;
    text-transform: none !important;
}
.MuiButton-text:hover,
.MuiButton-outlined:hover {
    color: #d6a33c !important;
    background-color: rgba(214, 163, 60, 0.06) !important;
}

/* ── Links ────────────────────────────────────────────────────────── */
a, a:visited {
    color: #d6a33c !important;
    text-decoration: none !important;
}
a:hover {
    color: #e5b96a !important;
    text-decoration: underline !important;
}

/* ── Checkbox / toggle ───────────────────────────────────────────── */
.MuiCheckbox-root {
    color: #484f58 !important;
}
.MuiCheckbox-root.Mui-checked {
    color: #d6a33c !important;
}

/* ── "Remember me" label ─────────────────────────────────────────── */
.MuiFormControlLabel-label {
    font-size: 13px !important;
    color: #8b949e !important;
}

/* ── Error / alert messages ──────────────────────────────────────── */
.MuiAlert-root {
    background-color: rgba(248, 81, 73, 0.08) !important;
    border: 1px solid rgba(248, 81, 73, 0.3) !important;
    border-radius: 10px !important;
    color: #f85149 !important;
}

.MuiAlert-standardSuccess {
    background-color: rgba(63, 185, 80, 0.08) !important;
    border-color: rgba(63, 185, 80, 0.3) !important;
    color: #3fb950 !important;
}

/* ── Language selector — hidden (single-user, English only) ──────── */
[class*="LocaleSelect"],
[class*="locale"],
[class*="LanguageSelect"],
[class*="language"],
[aria-label*="anguage"],
[role="combobox"],
.MuiSelect-root,
footer select,
#locale-selector {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* ── Footer / powered-by — ultra subtle ──────────────────────────── */
footer,
[class*="PoweredBy"],
[class*="powered"] {
    opacity: 0.15 !important;
    font-size: 10px !important;
}

/* ── Divider lines ───────────────────────────────────────────────── */
.MuiDivider-root,
hr {
    border-color: #21262d !important;
}

/* ── Scrollbar (WebKit) ──────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0d1117;
}
::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ── Selection highlight ─────────────────────────────────────────── */
::selection {
    background: rgba(214, 163, 60, 0.25);
    color: #e6edf3;
}
