:root {
    color-scheme: light;
    --forest-950: #012e1c;
    --forest-900: #063b00;
    --forest-800: #096235;
    --forest-700: #0b7540;
    --lime: #90b800;
    --gold: #e1e100;
    --red: #d7352a;
    --ink: #153027;
    --muted: #65766f;
    --line: #dce7e1;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--forest-950);
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 32px;
    color: var(--ink);
    background:
        linear-gradient(115deg, rgba(1, 46, 28, .18), rgba(1, 46, 28, .72)),
        url("jiwaka-webmail-bg.webp") center / cover no-repeat fixed;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-shell {
    width: min(1220px, 100%);
    min-height: min(750px, calc(100vh - 64px));
    min-height: min(750px, calc(100dvh - 64px));
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 32px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 34px 90px rgba(0, 35, 20, .42);
    backdrop-filter: blur(10px);
}

.brand-panel {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(36px, 5vw, 72px);
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(1, 46, 28, .48), rgba(1, 46, 28, .82)),
        url("jiwaka-webmail-bg.webp") 36% center / cover no-repeat;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    right: -210px;
    bottom: -210px;
    border: 72px solid rgba(225, 225, 0, .14);
    border-radius: 50%;
    pointer-events: none;
}

.brand-topline,
.brand-copy,
.brand-foot {
    position: relative;
    z-index: 1;
}

.brand-topline {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: .79rem;
    font-weight: 800;
    letter-spacing: .17em;
}

.brand-topline span {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 5px rgba(225, 225, 0, .16);
}

.brand-copy {
    max-width: 570px;
    margin-block: 54px;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--gold);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.brand-copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.6rem, 5vw, 4.9rem);
    font-weight: 800;
    line-height: .98;
    letter-spacing: -.055em;
}

.brand-description {
    max-width: 520px;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.7;
}

.benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.benefits li {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 9px 14px 9px 10px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: rgba(255, 255, 255, .9);
    background: rgba(0, 32, 19, .32);
    font-size: .82rem;
}

.benefits li > span {
    display: grid;
    width: 28px;
    height: 28px;
    margin-right: 10px;
    place-items: center;
    border-radius: 50%;
    color: var(--forest-950);
    background: linear-gradient(135deg, var(--gold), var(--lime));
    font-weight: 900;
}

.brand-foot {
    margin: 0;
    color: rgba(255, 255, 255, .66);
    font-size: .79rem;
}

.form-panel {
    position: relative;
    display: grid;
    min-width: 0;
    place-items: center;
    padding: clamp(28px, 5vw, 64px);
    background:
        radial-gradient(circle at 100% 0, rgba(144, 184, 0, .11), transparent 35%),
        rgba(250, 253, 251, .98);
}

.form-panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--forest-800), var(--lime) 46%, var(--gold) 78%, var(--red));
    pointer-events: none;
}

.login-card {
    width: min(100%, 420px);
}

.logo {
    display: block;
    width: auto;
    max-width: 160px;
    height: auto;
    max-height: 120px;
    margin: 0 0 30px;
    object-fit: contain;
    object-position: left center;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
    padding: 7px 11px;
    border: 1px solid #cfe0d6;
    border-radius: 999px;
    color: var(--forest-700);
    background: #f0f8f3;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.045em;
}

.instruction {
    margin: 10px 0 26px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.notice {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 12px;
    font-size: .9rem;
    line-height: 1.45;
}

.notice-error {
    color: #84211b;
    border-color: #efc5c2;
    background: #fff2f1;
}

.notice-success {
    color: #075c34;
    border-color: #bfe0cd;
    background: #eff9f3;
}

.field + .field {
    margin-top: 18px;
}

label {
    display: block;
    margin: 0 0 8px;
    color: #365147;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .015em;
}

input {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 56px;
    min-height: 56px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    padding: 0 16px 0 48px;
    color: var(--ink);
    background-color: #fff;
    background-position: 16px center;
    background-repeat: no-repeat;
    background-size: 19px 19px;
    box-shadow: 0 5px 16px rgba(8, 70, 40, .035);
    opacity: 1;
    font: inherit;
    font-size: 16px;
    line-height: normal;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto;
    touch-action: auto;
    user-select: text;
    -webkit-user-select: text;
    caret-color: var(--forest-900);
    -webkit-text-fill-color: var(--ink);
}

input[type="email"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23729184' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5h16v13H4zM4 7l8 6 8-6'/%3E%3C/svg%3E");
}

input[type="password"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23729184' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.7-2.8 8-7 10-4.2-2-7-5.3-7-10V6zM9.2 12.2l1.8 1.8 3.8-4'/%3E%3C/svg%3E");
}

input::placeholder {
    color: #96a69f;
    -webkit-text-fill-color: #96a69f;
}

input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px rgba(144, 184, 0, .17), 0 8px 22px rgba(8, 70, 40, .06);
}

button {
    width: 100%;
    min-height: 58px;
    margin-top: 26px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(120deg, var(--forest-900), var(--forest-700));
    box-shadow: 0 14px 28px rgba(6, 75, 42, .24);
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

button:focus-visible {
    outline: 3px solid rgba(144, 184, 0, .48);
    outline-offset: 3px;
}

.support {
    margin: 22px 0 0;
    color: #6f827a;
    text-align: center;
    font-size: .88rem;
}

.trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 24px 0 0;
    color: #7a8e85;
    font-size: .78rem;
}

@media (max-width: 900px) {
    body {
        padding: 18px;
        background-attachment: scroll;
    }

    .login-shell {
        min-height: calc(100vh - 36px);
        min-height: calc(100dvh - 36px);
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: 300px;
        padding: 32px;
    }

    .brand-copy {
        margin-block: 34px 15px;
    }

    .brand-copy h1 {
        font-size: clamp(2.35rem, 10vw, 4rem);
    }

    .benefits,
    .brand-foot {
        display: none;
    }

    .form-panel {
        padding: 46px 28px;
    }
}

@media (max-width: 560px) {
    html {
        background: #f8fbf9;
    }

    body {
        display: block;
        min-height: 100dvh;
        padding: 0;
        background: #f8fbf9;
    }

    .login-shell {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .brand-panel {
        min-height: 226px;
        padding: calc(27px + env(safe-area-inset-top)) 24px 27px;
        background-position: 32% 44%;
    }

    .brand-topline {
        font-size: .68rem;
    }

    .brand-copy {
        margin-block: auto 0;
    }

    .eyebrow,
    .brand-description {
        display: none;
    }

    .brand-copy h1 {
        font-size: clamp(2.15rem, 11vw, 3.15rem);
    }

    .form-panel {
        display: block;
        padding: 34px 24px calc(30px + env(safe-area-inset-bottom));
    }

    .login-card {
        margin: 0 auto;
    }

    .logo {
        max-width: 132px;
        max-height: 100px;
        margin-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}

/* jiwaka-signup-link */
.support a { color: var(--forest-700); font-weight: 800; text-decoration: none; }
.support a:hover { text-decoration: underline; }
