
:root {
    --navy: #173f5c;
    --navy-2: #0f3047;
    --green: #2f9178;
    --green-dark: #25735f;
    --mint: #edf7f4;
    --bg: #f4f7f8;
    --text: #173342;
    --muted: #667983;
    --line: #dce6e9;
    --white: #ffffff;
    --danger-bg: #fff0f0;
    --danger: #9c2f2f;
    --warning-bg: #fff8e6;
    --warning: #705200;
    --shadow: 0 20px 55px rgba(20, 54, 73, .12);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 12%, rgba(47,145,120,.10), transparent 29rem),
        radial-gradient(circle at 88% 8%, rgba(23,63,92,.08), transparent 34rem),
        var(--bg);
}

button, input { font: inherit; }

a { color: inherit; }

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    width: min(1180px, calc(100% - 40px));
    margin: 22px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-logo-wrap {
    width: 96px;
    height: 72px;
    display: grid;
    place-items: center;
    background: var(--white);
    border: 1px solid rgba(23,63,92,.08);
    border-radius: 16px;
    box-shadow: 0 7px 22px rgba(20,54,73,.08);
    overflow: hidden;
    padding: 6px;
}

.brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand strong {
    display: block;
    color: var(--navy);
    font-size: 1.08rem;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.logout {
    text-decoration: none;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255,255,255,.72);
    font-weight: 700;
    color: var(--navy);
}

.logout:hover { background: var(--white); }

.main {
    width: min(1060px, calc(100% - 40px));
    margin: auto;
    padding: 58px 0;
}

.login-card {
    display: grid;
    grid-template-columns: .82fr 1.18fr;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(23,63,92,.09);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.login-visual {
    min-height: 500px;
    padding: 52px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--white);
    background:
        linear-gradient(155deg, rgba(23,63,92,.96), rgba(18,64,77,.94)),
        var(--navy);
    position: relative;
    overflow: hidden;
}

.login-visual::before,
.login-visual::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

.login-visual::before {
    width: 270px;
    height: 270px;
    top: -80px;
    right: -90px;
}

.login-visual::after {
    width: 180px;
    height: 180px;
    left: -70px;
    bottom: 80px;
}

.shield {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    margin-bottom: auto;
    border-radius: 24px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.20);
    font-size: 38px;
    position: relative;
    z-index: 1;
}

.login-visual p {
    max-width: 330px;
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.45;
    font-weight: 650;
    position: relative;
    z-index: 1;
}

.login-content {
    padding: 64px 68px;
    align-self: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-size: .78rem;
    letter-spacing: .14em;
    font-weight: 800;
}

h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.lead {
    margin: 16px 0 30px;
    color: var(--muted);
    line-height: 1.6;
}

label {
    display: block;
    margin-bottom: 9px;
    font-size: .93rem;
    font-weight: 750;
    color: var(--navy);
}

.password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    border: 1px solid #cbd8dd;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.password-row:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(47,145,120,.12);
}

.password-row input {
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 14px 15px;
    color: var(--text);
    background: transparent;
}

.toggle-password {
    border: 0;
    border-left: 1px solid var(--line);
    padding: 0 15px;
    background: #f8fafb;
    color: var(--navy);
    cursor: pointer;
    font-weight: 700;
}

.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    background: var(--green);
    color: var(--white);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

form > .primary {
    width: 100%;
    margin-top: 15px;
}

.primary:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.privacy-note {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: .83rem;
    line-height: 1.5;
}

.notice {
    margin-bottom: 22px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .9rem;
    line-height: 1.45;
}

.notice.error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #f0cccc;
}

.notice.warning {
    color: var(--warning);
    background: var(--warning-bg);
    border: 1px solid #eadba9;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
}

.panel-header p:not(.eyebrow) {
    max-width: 700px;
    margin: 15px 0 0;
    line-height: 1.62;
    color: var(--muted);
}

.status-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--mint);
    color: var(--green-dark);
    font-size: .84rem;
    font-weight: 800;
}

.status-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.mailbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.mailbox-card {
    display: flex;
    gap: 20px;
    padding: 28px;
    border-radius: 22px;
    background: var(--white);
    border: 1px solid rgba(23,63,92,.09);
    box-shadow: 0 10px 32px rgba(20,54,73,.07);
}

.mail-icon {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--mint);
    color: var(--green);
    font-size: 24px;
}

.mailbox-body { min-width: 0; }

.mailbox-body h2 {
    margin: 2px 0 6px;
    color: var(--navy);
    font-size: 1.25rem;
}

.address {
    overflow-wrap: anywhere;
    color: var(--green-dark);
    font-weight: 750;
    font-size: .92rem;
}

.mailbox-body p {
    margin: 14px 0 22px;
    color: var(--muted);
    line-height: 1.55;
    font-size: .92rem;
}

.mailbox-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.copy {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 15px;
    background: var(--white);
    color: var(--navy);
    cursor: pointer;
    font-weight: 800;
}

.copy:hover { background: #f8fafb; }

.action-link { padding: 12px 15px; }

.help-card {
    margin-top: 20px;
    padding: 22px 24px;
    border-radius: 18px;
    background: rgba(255,255,255,.65);
    border: 1px solid var(--line);
}

.help-card strong { color: var(--navy); }

.help-card p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

footer {
    width: min(1060px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 28px;
    color: #829199;
    font-size: .78rem;
    text-align: center;
}

@media (max-width: 820px) {
    .main { padding: 36px 0; }

    .login-card { grid-template-columns: 1fr; }

    .login-visual {
        min-height: 230px;
        padding: 34px;
    }

    .shield { width: 66px; height: 66px; font-size: 28px; }

    .login-visual p {
        margin-top: 35px;
        font-size: 1.15rem;
    }

    .login-content { padding: 38px 34px 42px; }

    .mailbox-grid { grid-template-columns: 1fr; }

    .panel-header { display: block; }

    .status-pill { margin-top: 18px; }
}

@media (max-width: 520px) {
    .topbar,
    .main,
    footer {
        width: min(100% - 24px, 1060px);
    }

    .topbar {
        margin-top: 12px;
        align-items: flex-start;
    }

    .brand-logo-wrap {
        width: 78px;
        height: 60px;
        padding: 5px;
    }

    .brand img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .brand strong { font-size: .95rem; }
    .brand small { font-size: .75rem; }

    .logout { padding: 8px 10px; font-size: .82rem; }

    .login-card { border-radius: 20px; }
    .login-content { padding: 30px 22px 34px; }
    .login-visual { min-height: 195px; padding: 25px; }

    .mailbox-card {
        display: block;
        padding: 22px;
    }

    .mail-icon { margin-bottom: 16px; }

    .mailbox-actions {
        flex-direction: column;
    }

    .mailbox-actions > * { width: 100%; }

    h1 { font-size: 2.15rem; }
}
