/* Visual language carried over from the Keycloakify theme: navy brand panel,
   gold accent, serif display face. No external font requests — the login page
   must render before anything else on the network is reachable. */

:root {
    --navy: #1A2B3C;
    --navy-deep: #0d1e2b;
    --navy-hover: #223649;
    --gold: #C8873A;
    --text-main: #1A2B3C;
    --text-muted: #6B7280;
    --text-light: #F3F4F6;
    --border: #E5E7EB;
    --bg-form: #FFFFFF;
    --danger: #B42318;
    --success: #067647;

    --radius-lg: 8px;
    --radius-sm: 6px;
    --input-height: 44px;
    --shadow-card: 0 4px 6px -1px rgba(26, 43, 60, .06), 0 2px 4px -1px rgba(26, 43, 60, .04);

    --font-main: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    color: var(--text-main);
    background: var(--bg-form);
    -webkit-font-smoothing: antialiased;
}

.root {
    display: flex;
    min-height: 100vh;
}

/* ── Brand panel ─────────────────────────────────────────────────────────── */

.brand {
    display: none;
    width: 45%;
    position: relative;
    background: linear-gradient(145deg, var(--navy) 0%, var(--navy-deep) 100%);
    color: var(--text-light);
    padding: 5rem;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .brand { display: flex; }
}

.brand-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.brand-content { position: relative; z-index: 2; }

.brand-mark {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    letter-spacing: .02em;
    margin: 0 0 3rem;
    color: #fff;
}

.brand-mark::after {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    margin-top: .75rem;
    background: var(--gold);
}

.brand-tagline {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: 0 0 1.5rem;
    color: #fff;
}

.brand-subcopy {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .55);
    max-width: 85%;
    font-weight: 300;
    margin: 0;
}

/* ── Form panel ──────────────────────────────────────────────────────────── */

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.card {
    width: 100%;
    max-width: 400px;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -.02em;
    margin: 0 0 .5rem;
}

.card-sub,
.hint {
    color: var(--text-muted);
    font-size: .9375rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.panel-footer {
    margin-top: 1.75rem;
    font-size: .875rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 400px;
}

/* ── Form controls ───────────────────────────────────────────────────────── */

.flow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

.field-label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-main);
}

.field input {
    height: var(--input-height);
    padding: 0 .875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9375rem;
    color: var(--text-main);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 43, 60, .08);
}

.check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--navy);
}

.btn {
    height: var(--input-height);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

.btn-primary {
    background: var(--navy);
    color: #fff;
}

.btn-primary:hover { background: var(--navy-hover); }

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--navy); }

.link {
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 1px;
}

.link:hover { color: var(--gold); }

/* ── Messages ────────────────────────────────────────────────────────────── */

.msg {
    font-size: .875rem;
    line-height: 1.5;
    padding: .75rem .875rem;
    border-radius: var(--radius-sm);
    margin: 0;
}

.msg-error {
    color: var(--danger);
    background: #FEF3F2;
    border: 1px solid #FEE4E2;
}

.msg-success {
    color: var(--success);
    background: #ECFDF3;
    border: 1px solid #D1FADF;
}

.msg-info {
    color: var(--text-muted);
    background: #F9FAFB;
    border: 1px solid var(--border);
}

/* ── Consent ─────────────────────────────────────────────────────────────── */

.consent-client {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #F9FAFB;
    margin-bottom: 1.25rem;
}

.consent-app {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 .25rem;
}

.consent-client .hint { margin: 0; }

.scopes {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.scopes li {
    display: flex;
    flex-direction: column;
    gap: .125rem;
    padding-left: 1.25rem;
    position: relative;
    font-size: .875rem;
}

.scopes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .45rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.scopes code,
.hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem;
    color: var(--navy);
}

.scopes span { color: var(--text-muted); }

/* ── Misc ────────────────────────────────────────────────────────────────── */

.qr {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.secrets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
    list-style: none;
    padding: 1rem;
    margin: 0;
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem;
}

.detail {
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem;
    font-size: .8125rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
