/* A5L Identity Platform — Login Theme */
:root {
    --bg:           #0d1117;
    --card-bg:      #161b22;
    --border:       #30363d;
    --primary:      #2563eb;
    --primary-hover:#1d4ed8;
    --text:         #f0f6fc;
    --text-muted:   #8b949e;
    --input-bg:     #0d1117;
    --error:        #f85149;
    --success:      #3fb950;
    --warning:      #d29922;
    --info:         #58a6ff;
    --radius:       8px;
    --shadow:       0 8px 32px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* === Card === */
.a5l-wrapper {
    width: 100%;
    max-width: 420px;
}

.a5l-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.a5l-card--wide {
    max-width: 560px;
}

/* === Header / Logo === */
.a5l-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.a5l-logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary);
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.a5l-realm {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* === Header text (page subtitle) === */
.a5l-header-text {
    margin-bottom: 1.25rem;
}

.a5l-header-text h1,
.a5l-header-text #kc-page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

/* === Alerts === */
.a5l-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.a5l-alert--error   { background: rgba(248,81,73,.12); border-color: var(--error);   color: var(--error); }
.a5l-alert--success { background: rgba(63,185,80,.12); border-color: var(--success); color: var(--success); }
.a5l-alert--warning { background: rgba(210,153,34,.12); border-color: var(--warning); color: var(--warning); }
.a5l-alert--info    { background: rgba(88,166,255,.12); border-color: var(--info);   color: var(--info); }

.a5l-alert-icon { font-size: 1rem; flex-shrink: 0; }

/* === Form === */
.a5l-form label,
label[for] {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.a5l-form input[type="text"],
.a5l-form input[type="password"],
.a5l-form input[type="email"],
.a5l-form select,
input.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}

.kcFormGroupClass,
.pf-v5-c-form__group,
div[class*="form-group"] {
    margin-bottom: 1rem;
}

/* === Buttons === */
input[type="submit"],
button[type="submit"],
.btn,
.kcButtonClass {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
    margin-top: 0.5rem;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.btn:hover {
    background: var(--primary-hover);
}

input[type="submit"]:active { transform: scale(.98); }

/* === Links === */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--info); }

/* === Form options (remember me / forgot password) === */
#kc-form-options,
.kcFormOptionsClass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
}

/* === TOTP / QR setup === */
#kc-totp-secret-qr-code img { border-radius: var(--radius); margin: 0 auto; display: block; }
#kc-totp-secret-key        { font-family: monospace; font-size: 0.85rem; color: var(--info); word-break: break-all; background: var(--input-bg); padding: .5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.totp-secret-mode          { display: flex; gap: .5rem; margin: .75rem 0; font-size: .8rem; }
.totp-secret-mode a        { padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 4px; }

/* === App list (TOTP supported apps) === */
#kc-totp-supported-apps    { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
#kc-totp-supported-apps li { background: rgba(37,99,235,.15); border: 1px solid var(--border); border-radius: 4px; padding: .2rem .6rem; font-size: .8rem; color: var(--text-muted); }

/* === Info block === */
.a5l-info {
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
    padding-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* === Social providers === */
.a5l-social {
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

/* === Responsive === */
@media (max-width: 480px) {
    .a5l-card { padding: 1.25rem; }
    .a5l-logo { font-size: 1.6rem; }
}
