/* The sign-in page (owner, 20 Nov 2026, #126: a solar company's login, not a generic purple card).
   Desktop: a dawn-sky solar scene on the left, the form on the right. Phone: the scene shrinks to a band at the
   top and the form card rises over it. The page scrolls (it used to be overflow:hidden, which trapped the form
   under a phone keyboard). Colours come from the ERP's sun-and-bolt mark (static/favicon.svg). */

:root {
    --login-sun: #f2b330;
    --login-sun-deep: #d98a00;
    --login-sun-soft: #ffd56b;
    --login-ink: #10213a;
    --login-muted: #56667d;
    --login-line: #d6dde8;
    --login-field: #f7f9fc;
    --login-page: #f3f5fa;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--login-page);
    color: var(--login-ink);
    -webkit-font-smoothing: antialiased;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* ---- The solar scene ------------------------------------------------------------------------------------ */

.login-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 40px 48px 0;
    color: #ffffff;
    background: linear-gradient(180deg, #071830 0%, #0e2c55 46%, #1d568f 76%, #e9a23b 100%);
}

.hero-sun {
    position: absolute;
    z-index: -1;
    top: 5%;
    right: 8%;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle at 42% 40%, #fff4cf 0%, #ffd56b 38%, #f2b330 72%);
    box-shadow: 0 0 60px 18px rgba(242, 179, 48, 0.45), 0 0 180px 90px rgba(242, 179, 48, 0.16);
    animation: login-sun-glow 7s ease-in-out infinite;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-logo {
    display: block;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.hero-logo svg,
.login-logo svg {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-name {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.hero-copy {
    max-width: 440px;
    margin-top: clamp(40px, 11vh, 130px);
}

.hero-copy h2 {
    margin: 0 0 16px;
    font-size: clamp(1.9rem, 1.2rem + 1.9vw, 2.8rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.01em;
}

.hero-highlight {
    color: var(--login-sun-soft);
}

.hero-copy p {
    margin: 0 0 26px;
    color: #c8d5ec;
    font-size: 1.05rem;
    line-height: 1.6;
}

.hero-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.hero-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e6edf9;
    font-weight: 500;
}

.hero-points i {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(242, 179, 48, 0.38);
    background: rgba(242, 179, 48, 0.15);
    color: var(--login-sun-soft);
    font-size: 0.95rem;
}

.hero-panels {
    display: block;
    width: 100%;
    max-width: 620px;
    margin: auto auto 0;
    padding-top: 32px;
}

/* ---- The form ------------------------------------------------------------------------------------------- */

.login-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 40px 24px;
    background: radial-gradient(circle at 100% 0%, rgba(242, 179, 48, 0.12), rgba(242, 179, 48, 0) 42%), var(--login-page);
}

.login-card {
    width: 100%;
    max-width: 410px;
    padding: 36px 32px 26px;
    border: 1px solid #e3e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 33, 58, 0.06), 0 20px 50px rgba(16, 33, 58, 0.1);
}

.login-header {
    margin-bottom: 26px;
    text-align: center;
}

.login-logo {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(242, 179, 48, 0.35);
}

.login-header h1 {
    margin: 0 0 6px;
    color: var(--login-ink);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.login-header p {
    margin: 0;
    color: var(--login-muted);
    font-size: 0.97rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #24364f;
    font-size: 0.88rem;
    font-weight: 600;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #8a99b1;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.15s;
}

.input-wrap:focus-within .input-icon {
    color: var(--login-sun-deep);
}

.input-wrap input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    border: 1.5px solid var(--login-line);
    border-radius: 12px;
    background: var(--login-field);
    color: var(--login-ink);
    font: inherit;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.input-wrap.has-toggle input {
    padding-right: 52px;
}

.input-wrap input::placeholder {
    color: #97a4b8;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--login-sun);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(242, 179, 48, 0.22);
}

.input-wrap input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b7a90;
    font-size: 1rem;
    cursor: pointer;
}

.toggle-password:hover:not(:disabled) {
    background: #edf1f7;
    color: var(--login-ink);
}

.toggle-password:focus-visible {
    outline: 3px solid rgba(242, 179, 48, 0.65);
    outline-offset: 0;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f7c04a 0%, #f2a516 100%);
    color: #1a1305;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(242, 165, 22, 0.32);
    transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}

.login-button span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.login-button:hover:not(:disabled) {
    filter: brightness(1.04);
    box-shadow: 0 12px 28px rgba(242, 165, 22, 0.42);
    transform: translateY(-1px);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:focus-visible {
    outline: 3px solid var(--login-ink);
    outline-offset: 3px;
}

.login-button:disabled {
    cursor: progress;
    opacity: 0.85;
}

.login-button.is-done {
    background: linear-gradient(135deg, #22a559 0%, #15803d 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(21, 128, 61, 0.3);
    opacity: 1;
}

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid #f4c7c7;
    border-radius: 12px;
    background: #fdeded;
    color: #9f1c1c;
    font-size: 0.92rem;
    line-height: 1.45;
}

.login-error i {
    margin-top: 2px;
}

.login-help {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid #edf0f5;
    color: var(--login-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.login-help i {
    margin-top: 3px;
    color: var(--login-sun-deep);
}

.login-legal {
    margin: 0;
    color: #8592a7;
    font-size: 0.8rem;
}

/* ---- Phone and narrow tablet ---------------------------------------------------------------------------- */

/* Owner, 20 Nov 2026: on a phone the login sits in the MIDDLE of the screen -- the dawn sky fills the whole page
   and the brand, the line and the card are centred on it together (no empty grey half under the card). */
@media (max-width: 900px) {
    .login-page {
        position: relative;
        isolation: isolate;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 22px;
        padding: 32px 16px calc(28px + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        background:
            radial-gradient(ellipse 90% 45% at 50% 108%, rgba(242, 179, 48, 0.55) 0%, rgba(242, 179, 48, 0) 70%),
            linear-gradient(180deg, #071830 0%, #0e2c55 48%, #1a4f86 100%);
    }

    .login-hero {
        position: static;
        isolation: auto;
        overflow: visible;
        width: 100%;
        max-width: 420px;
        padding: 0;
        background: none;
        text-align: center;
    }

    .hero-brand {
        justify-content: center;
    }

    .hero-sun {
        top: 18px;
        right: 18px;
        width: 64px;
        height: 64px;
        box-shadow: 0 0 40px 12px rgba(242, 179, 48, 0.45), 0 0 110px 50px rgba(242, 179, 48, 0.16);
    }

    .hero-logo {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .hero-name {
        font-size: 1.15rem;
    }

    .hero-copy {
        max-width: none;
        margin: 16px auto 0;
    }

    .hero-copy h2 {
        margin: 0;
        font-size: 1.45rem;
    }

    .hero-copy p,
    .hero-points,
    .hero-panels,
    .login-logo {
        display: none;
    }

    .login-main {
        width: 100%;
        max-width: 420px;
        padding: 0;
        gap: 16px;
        background: none;
    }

    .login-card {
        padding: 26px 20px 22px;
        border: 0;
        border-radius: 18px;
        box-shadow: 0 24px 60px rgba(3, 12, 28, 0.45);
    }

    .login-legal {
        color: rgba(255, 255, 255, 0.78);
    }

    .login-header {
        margin-bottom: 22px;
    }
}

/* Short phones (640-700 px tall): tighter spacing so the whole login still fits on one screen. */
@media (max-width: 900px) and (max-height: 700px) {
    .login-page {
        gap: 14px;
        padding-top: 18px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .hero-copy {
        margin-top: 10px;
    }

    .login-main {
        gap: 10px;
    }

    .login-card {
        padding: 20px 18px 16px;
    }

    .login-header {
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .login-help {
        margin-top: 14px;
        padding-top: 12px;
    }
}

@media (max-width: 380px) {
    .hero-copy h2 {
        font-size: 1.3rem;
    }
}

@keyframes login-sun-glow {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.04); filter: brightness(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-sun {
        animation: none;
    }

    .login-button {
        transition: none;
    }
}
