: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;
}

.signup-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;
}

.signup-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;
    }

    .signup-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;
    }

    .signup-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));
    }

    .signup-card {
        margin: 0 auto;
    }

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

.policy-body {
    display: block;
    padding: 38px 22px;
    background:
        linear-gradient(125deg, rgba(1, 46, 28, .28), rgba(1, 46, 28, .78)),
        url("jiwaka-webmail-bg.webp") center / cover fixed;
}

.policy-shell {
    width: min(980px, 100%);
    margin: 0 auto;
}

.policy-header {
    display: grid;
    grid-template-columns: 118px 1fr;
    align-items: center;
    gap: 25px;
    padding: 30px;
    border-radius: 24px;
    color: #fff;
    background: rgba(1, 46, 28, .9);
    box-shadow: 0 24px 70px rgba(0, 25, 15, .34);
}

.policy-header img {
    width: 118px;
    height: auto;
}

.policy-header .eyebrow {
    margin-bottom: 7px;
}

.policy-header h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    line-height: 1;
}

.policy-header p:last-child {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .75);
}

.policy-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 18px 0;
}

.policy-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--forest-900);
    background: #fff;
    text-decoration: none;
}

.policy-card {
    margin-top: 18px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 20px 60px rgba(0, 25, 15, .2);
}

.policy-card h2 {
    color: var(--forest-900);
}

.policy-card h3 {
    margin: 25px 0 7px;
    color: var(--forest-800);
}

.policy-card p,
.policy-card li {
    color: #40584f;
    line-height: 1.72;
}

.policy-card li + li {
    margin-top: 7px;
}

.policy-footer {
    margin: 20px 0 0;
    padding: 20px;
    color: rgba(255, 255, 255, .8);
    text-align: center;
}

.policy-footer a {
    color: var(--gold);
}

@media (max-width: 560px) {
    .policy-body {
        padding: 0;
    }

    .policy-header {
        grid-template-columns: 82px 1fr;
        border-radius: 0;
        padding: calc(22px + env(safe-area-inset-top)) 20px 22px;
    }

    .policy-header img {
        width: 82px;
    }

    .policy-nav,
    .policy-card,
    .policy-footer {
        margin-right: 14px;
        margin-left: 14px;
    }
}

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

/* Signup-specific layout. Inputs remain direct native controls on mobile. */
body {
    align-items: start;
}

.signup-shell {
    width: min(1420px, 100%);
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    grid-template-columns: minmax(390px, .82fr) minmax(600px, 1.18fr);
}

.brand-panel {
    min-height: 100%;
}

.brand-copy h1 {
    font-size: clamp(2.7rem, 4.5vw, 4.8rem);
}

.form-panel {
    place-items: start center;
    padding: clamp(30px, 4vw, 58px);
}

.signup-card {
    width: min(100%, 790px);
}

.form-header {
    display: grid;
    grid-template-columns: 118px 1fr;
    align-items: center;
    gap: 26px;
    margin-bottom: 30px;
}

.form-header .logo {
    width: 118px;
    max-width: 118px;
    max-height: 108px;
    margin: 0;
}

.form-header h2 {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
}

.form-header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.form-header .secure-badge {
    margin-bottom: 10px;
}

fieldset {
    min-width: 0;
    margin: 0 0 24px;
    padding: 24px;
    border: 1px solid #d9e8df;
    border-radius: 20px;
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 12px 34px rgba(6, 59, 0, .045);
}

legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 0;
    color: var(--forest-900);
    font-size: 1.05rem;
    font-weight: 850;
}

legend span {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--forest-950);
    background: linear-gradient(135deg, var(--gold), var(--lime));
    font-size: .85rem;
}

.form-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.form-grid:first-of-type {
    margin-top: 8px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signup-card label,
.signup-card .full {
    min-width: 0;
    margin: 0;
}

.signup-card label > span:first-child,
.signup-card .full > span:first-child {
    display: block;
    margin-bottom: 8px;
    color: #365147;
    font-size: .86rem;
    font-weight: 800;
}

.signup-card input:not([type="checkbox"]),
.signup-card select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 54px;
    min-height: 54px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: 0;
    padding: 0 15px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 5px 16px rgba(8, 70, 40, .035);
    opacity: 1;
    font: inherit;
    font-size: 16px;
    line-height: normal;
    pointer-events: auto;
    touch-action: auto;
    user-select: text;
    -webkit-user-select: text;
    caret-color: var(--forest-900);
    -webkit-text-fill-color: var(--ink);
}

.signup-card input[type="email"],
.signup-card input[type="password"] {
    background-image: none;
}

.signup-card input[type="date"] {
    appearance: auto;
    -webkit-appearance: auto;
}

.signup-card select {
    appearance: auto;
    -webkit-appearance: menulist;
}

.signup-card input:not([type="checkbox"]):focus,
.signup-card select:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px rgba(144, 184, 0, .17), 0 8px 22px rgba(8, 70, 40, .06);
}

.signup-card small {
    display: block;
    margin-top: 7px;
    color: #71827b;
    font-size: .76rem;
    font-weight: 500;
    line-height: 1.45;
}

.address-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(8, 70, 40, .035);
}

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

.signup-card .address-input input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.signup-card .address-input input:focus {
    box-shadow: none;
}

.address-input strong {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-left: 1px solid var(--line);
    color: var(--forest-800);
    background: #f1f7f3;
    font-size: .9rem;
    white-space: nowrap;
}

.status.is-checking {
    color: #7d6b00;
}

.status.is-available {
    color: #08713f;
    font-weight: 750;
}

.status.is-taken,
.status.is-forbidden,
.status.is-invalid,
.status.is-unavailable,
.field-error {
    color: #a52820;
    font-weight: 750;
}

.field-error {
    display: block;
    margin-top: 7px;
    font-size: .77rem;
    line-height: 1.4;
}

.agreements {
    margin: 6px 0 0;
    padding: 20px 22px;
    border-radius: 17px;
    background: #edf6f0;
}

.check-row {
    display: grid !important;
    grid-template-columns: 22px 1fr;
    align-items: start;
    gap: 11px;
    color: #425d52;
    font-weight: 600 !important;
    line-height: 1.5;
}

.check-row + .check-row {
    margin-top: 13px !important;
}

.signup-card input[type="checkbox"] {
    position: static;
    z-index: auto;
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--forest-700);
    appearance: auto;
    -webkit-appearance: checkbox;
}

.check-row > span {
    margin: 0 !important;
    font-size: .84rem !important;
    font-weight: 600 !important;
}

a {
    color: var(--forest-700);
    font-weight: 800;
}

.primary-button {
    min-height: 60px;
}

.form-foot {
    margin: 20px 0 4px;
    color: #6f827a;
    text-align: center;
    font-size: .88rem;
}

.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.verify-card {
    width: min(100%, 510px);
    margin: auto;
}

.verify-code {
    text-align: center;
    letter-spacing: .45em;
    font-size: 1.35rem !important;
    font-weight: 850 !important;
}

.secondary-form button {
    min-height: 48px;
    margin-top: 12px;
    color: var(--forest-800);
    border: 1px solid #cfe0d6;
    background: #f0f8f3;
    box-shadow: none;
}

@media (max-width: 1050px) {
    .signup-shell {
        grid-template-columns: minmax(330px, .75fr) minmax(530px, 1.25fr);
    }

    .form-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .signup-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: 330px;
    }
}

@media (max-width: 650px) {
    .form-header {
        grid-template-columns: 88px 1fr;
        gap: 18px;
    }

    .form-header .logo {
        width: 88px;
    }

    .form-grid.two,
    .form-grid.three {
        grid-template-columns: 1fr;
    }

    fieldset {
        padding: 19px 16px;
        border-radius: 16px;
    }
}

@media (max-width: 560px) {
    .brand-panel {
        min-height: 238px;
    }

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

    .form-header {
        grid-template-columns: 1fr;
    }

    .form-header .logo {
        width: 116px;
    }

    .form-header h2 {
        font-size: 2rem;
    }

    .address-input strong {
        padding-inline: 10px;
        font-size: .82rem;
    }
}
