/* Plagium SSO landing — matches app-plagium-v3's /[lang]/login.
 *
 * Two-column 896px card. Left half is a blue-gradient hero
 * (#5b88ff → #152f72) carrying the brand wordmark + illustration +
 * tagline. Right half is the form panel: institution picker +
 * Cancel/Submit row. Below 640px the columns stack.
 *
 * Brand tokens — swap when real Plagium tokens land:
 *   --brand           #2E5BFF  primary action / focus ring
 *   --brand-hover     #2549d6
 *   --hero-from       #5b88ff  top-left of the hero gradient
 *   --hero-to         #152f72  bottom-right of the hero gradient
 *   --ink             #0F172A  body text
 *   --muted           #64748B  secondary text
 *   --hero-muted      #BBCEFF  tagline text on the hero
 */

:root {
    --brand: #2E5BFF;
    --brand-hover: #2549d6;
    --hero-from: #5b88ff;
    --hero-to: #152f72;
    --hero-muted: #BBCEFF;
    --ink: #0F172A;
    --muted: #64748B;
    --bg: #FFFFFF;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --secondary-bg: #F1F5F9;
    --secondary-hover: #E2E8F0;
    --danger: #DC2626;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: 896px;
    max-width: 100%;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 75px 0 rgba(0, 0, 0, 0.25);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}
.auth-card-error { grid-template-columns: 1fr; }

/* ── Hero (left column) ──────────────────────────────────────────── */
.hero {
    background: linear-gradient(to bottom left, var(--hero-from), var(--hero-to));
    color: white;
    padding: 32px 45px 56px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.hero-top {
    display: flex;
    justify-content: flex-end;
}
.lang-switcher {
    display: inline-flex;
    gap: 4px;
    font-size: 12px;
    letter-spacing: 0.06em;
}
.lang-switcher .lang {
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--hero-muted);
    text-decoration: none;
    font-weight: 500;
    transition: background-color .15s, color .15s;
}
.lang-switcher .lang:hover {
    background: rgba(255, 255, 255, 0.10);
    color: white;
}
.lang-switcher .lang.active {
    background: rgba(255, 255, 255, 0.20);
    color: white;
    font-weight: 600;
}

.hero-art {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.hero-art .logo {
    width: 106px;
    height: auto;
}
.hero-art .illustration {
    align-self: stretch;
    height: 223px;
    object-fit: contain;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.hero-welcome {
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
}
.hero-welcome-line {
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.hero-brand {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-top: 2px;
}
.hero-tagline {
    margin: 0;
    font-size: 14px;
    color: var(--hero-muted);
    line-height: 20px;
    max-width: 85%;
}

/* ── Form panel (right column) ───────────────────────────────────── */
.form-panel {
    padding: 44px 34px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-header { margin-bottom: 17px; }
.form-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 13px;
}
.form-title-accent { color: var(--brand); }
.form-lede {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}

.combobox { position: relative; }

input[type="search"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
input[type="search"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    min-height: 16px;
}

ul#results {
    list-style: none;
    padding: 4px;
    margin: 6px 0 16px;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
ul#results[hidden] { display: none; }
ul#results li {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
ul#results li[aria-selected="true"],
ul#results li:hover {
    background: color-mix(in srgb, var(--brand) 10%, transparent);
}
ul#results li img {
    width: 24px; height: 24px; object-fit: contain; flex: 0 0 24px;
}
ul#results li .meta {
    color: var(--muted);
    font-size: 12px;
    margin-left: auto;
}

/* ── Actions row ─────────────────────────────────────────────────── */
.actions {
    margin-top: 4px;
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.actions .btn { flex: 1 1 0; }
/* Cancel a hair narrower than Login — preserves visual weight on
   the primary action while keeping both reachable. */
.actions .btn-secondary { flex: 0 1 38%; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, color .15s, opacity .15s, box-shadow .15s;
    font-family: inherit;
    line-height: 1.2;
}
.btn-primary {
    background: var(--brand);
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.btn-secondary {
    background: var(--secondary-bg);
    color: var(--ink);
}
.btn-secondary:hover { background: var(--secondary-hover); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}

.notice {
    margin-top: 16px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    color: var(--ink);
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}
.notice[hidden] { display: none; }

/* ── Error card variant ──────────────────────────────────────────── */
.error-title {
    color: var(--danger);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}
.error-detail {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 16px;
}

/* ── Stack on narrow screens ─────────────────────────────────────── */
@media (max-width: 640px) {
    .auth-card { grid-template-columns: 1fr; }
    .hero {
        padding: 24px 24px 32px;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .hero-art .illustration { height: 160px; }
    .form-panel { padding: 32px 24px; }
    .actions { flex-direction: column-reverse; gap: 8px; }
    .actions .btn-secondary { flex: 1; }
}
