/* Served from this origin only: the Content-Security-Policy forbids inline styles,
   and fonts and images from anywhere else. */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --page: #f2f2f4;
    --surface: #ffffff;
    --text: #15161c;
    --muted: #7b7f8c;
    --field: #f4f5f7;
    --field-focus: #ffffff;
    /* The two colours of the HISD3 logo: the cloud's blue and the gear's coral. */
    --blue: #1b6fe0;
    --blue-deep: #1259bd;
    --blue-soft: #b9d3f7;
    --coral: #e5533b;
    --error-bg: #fdecea;
    --error-text: #8a1c13;
    --radius-field: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--page);
    color: var(--text);
    font: 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Two-column shell ---------- */

.shell {
    width: 100%;
    max-width: 1240px;
    min-height: min(820px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 28px;
    background: var(--surface);
    border-radius: 36px;
}

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 72px 56px 0;
    overflow: hidden;
    color: #ffffff;
    border-radius: 44px;
    background:
        url("../img/grain.svg"),
        radial-gradient(120% 70% at 0% 0%, var(--blue-deep) 0%, transparent 60%),
        linear-gradient(180deg, var(--blue) 0%, #3d86e8 55%, var(--blue-soft) 100%);
}

.hero-title {
    margin: 0;
    font-size: clamp(2.4rem, 4.2vw, 3.6rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.underlined {
    position: relative;
    white-space: nowrap;
}

.swoosh {
    position: absolute;
    left: 4%;
    bottom: -0.22em;
    width: 96%;
    height: 0.28em;
}

.hero-text {
    max-width: 30rem;
    margin: 40px 0 0;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.6;
    opacity: 0.95;
}

.hero-art {
    width: 100%;
    max-width: 560px;
    height: auto;
    margin-top: auto;
    padding-top: 32px;
    align-self: center;
}

/* ---------- Sign-in panel ---------- */

.panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 48px 8px;
    align-self: center;
    text-align: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    max-width: 100%;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* A hospital's name can be long: it wraps beside the logo, which keeps its size. */
.brand img { flex-shrink: 0; }
.brand span { text-align: left; line-height: 1.15; }

h1 {
    margin: 36px 0 8px;
    font-size: clamp(2.2rem, 3.4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.subtitle {
    margin: 0 0 40px;
    color: var(--muted);
    font-size: 1.1rem;
}

form {
    display: grid;
    gap: 22px;
    text-align: left;
}

input {
    width: 100%;
    height: 64px;
    padding: 0 22px;
    font: inherit;
    font-size: 1.05rem;
    color: var(--text);
    background: var(--field);
    border: 2px solid transparent;
    border-radius: var(--radius-field);
    transition: border-color 0.15s, background-color 0.15s;
}

input::placeholder { color: var(--muted); }

input:focus {
    outline: none;
    background: var(--field-focus);
    border-color: var(--blue);
}

.password { position: relative; }
.password input { padding-right: 64px; }

.reveal {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transform: translateY(-50%);
}

.reveal:hover { color: var(--text); }
.reveal[hidden] { display: none; }
.reveal .icon-show { display: none; }
.reveal[aria-pressed="true"] .icon-show { display: block; }
.reveal[aria-pressed="true"] .icon-hide { display: none; }

.submit {
    height: 64px;
    margin-top: 18px;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--blue);
    border: 0;
    border-radius: var(--radius-field);
    box-shadow: 0 10px 24px -10px rgba(27, 111, 224, 0.7);
    cursor: pointer;
    transition: background-color 0.15s, transform 0.05s;
}

.submit:hover { background: var(--blue-deep); }
.submit:active { transform: translateY(1px); }

button:focus-visible,
.reveal:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.message {
    margin: 0 0 24px;
    padding: 14px 18px;
    color: var(--muted);
    background: var(--field);
    border-radius: 14px;
    text-align: left;
}

.message.error {
    color: var(--error-text);
    background: var(--error-bg);
}

.help {
    margin: 36px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Narrow screens: the form alone ---------- */

@media (max-width: 960px) {
    body { padding: 0; place-items: stretch; }
    .shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        padding: 16px;
        border-radius: 0;
    }
    .hero { display: none; }
    .panel { padding: 40px 8px; }
}

/* ---------- "Signed in" page (home.html) ---------- */

.card {
    width: 100%;
    max-width: 460px;
    padding: 40px;
    background: var(--surface);
    border-radius: 28px;
    text-align: center;
}

.card h1 { margin-top: 0; font-size: 2rem; }

.card form { margin-top: 28px; }

.card button {
    width: 100%;
    height: 56px;
    font: inherit;
    font-weight: 700;
    color: #ffffff;
    background: var(--blue);
    border: 0;
    border-radius: var(--radius-field);
    cursor: pointer;
}

.card .message { text-align: center; }
