@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

:root {
    --login-green: #01311f;
    --login-gold: #e6bd29;
    --login-gold-hover: #d5aa17;
    --login-text: #262525;
    --login-muted: #63657e;
    --login-border: #cccccc;
    --login-link: #0077ff;
    --login-error: #b42318;
    --login-error-bg: #fef3f2;
    --login-white: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--login-text);
    background: var(--login-green);
    font-family: "Roboto", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.auth-shell {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 2.4vh, 30px);
    padding: clamp(16px, 3vh, 40px) 24px;
}

.auth-card {
    --field-height: clamp(52px, 7.2vh, 75px);
    display: flex;
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100% - 70px);
    flex: 0 1 auto;
    flex-direction: column;
    align-items: center;
    padding: clamp(24px, 5.5vh, 61px) clamp(20px, 4vw, 55px) clamp(20px, 4vh, 42px);
    overflow: hidden;
    border-radius: 10px;
    background: var(--login-white);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.16);
}

.auth-logo {
    display: block;
    width: clamp(200px, 26vh, 294px);
    max-width: 82%;
    height: auto;
    flex: 0 0 auto;
}

.auth-panel {
    width: 100%;
}

.auth-panel[hidden] {
    display: none;
}

.auth-header {
    margin-top: clamp(12px, 2.6vh, 27px);
    text-align: center;
}

.auth-header h1 {
    margin: 0;
    font-size: clamp(28px, 3.6vh, 36px);
    line-height: 1.2;
    font-weight: 700;
}

.auth-header p {
    margin: clamp(8px, 1.4vh, 14px) 0 0;
    color: #000000;
    font-size: clamp(15px, 1.8vh, 18px);
    line-height: 1.45;
}

.auth-form {
    width: 100%;
    max-width: 470px;
    margin-top: clamp(18px, 4vh, 45px);
}

.form-field {
    position: relative;
    margin-bottom: clamp(10px, 1.5vh, 15px);
}

.form-field input {
    width: 100%;
    height: var(--field-height);
    padding: 0 54px 0 49px;
    border: 1px solid var(--login-border);
    border-radius: 5px;
    outline: none;
    color: var(--login-text);
    background: var(--login-white);
    font-size: clamp(16px, 1.8vh, 18px);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input::placeholder {
    color: var(--login-muted);
    opacity: 1;
}

.form-field input:hover {
    border-color: #9b9cac;
}

.form-field input:focus,
.compact-field input:focus {
    border-color: var(--login-link);
    box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.14);
}

.form-field input[aria-invalid="true"],
.compact-field input[aria-invalid="true"] {
    border-color: var(--login-error);
}

.field-icon,
.password-toggle {
    position: absolute;
    top: calc((var(--field-height) - 24px) / 2);
    width: 24px;
    height: 24px;
    color: var(--login-muted);
}

.field-icon {
    left: 15px;
    pointer-events: none;
}

.field-icon svg,
.password-toggle svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

.password-toggle {
    right: 15px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    cursor: pointer;
}

.password-toggle:focus-visible {
    border-radius: 3px;
    box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.22);
}

.field-error {
    display: block;
    margin: 6px 2px 0;
    color: var(--login-error);
    font-size: 13px;
    line-height: 1.3;
}

.field-error[hidden] {
    display: none;
}

.form-alert {
    margin: 24px 0 -24px;
    padding: 11px 14px;
    border: 1px solid #fecdca;
    border-radius: 5px;
    color: var(--login-error);
    background: var(--login-error-bg);
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
}

.form-alert-success {
    border-color: #a6d9bb;
    color: #0f6b3a;
    background: #eafaf1;
}

.form-options {
    display: flex;
    min-height: 28px;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin-top: clamp(12px, 2.4vh, 25px);
    color: var(--login-muted);
    font-size: clamp(14px, 1.8vh, 18px);
}

.form-options a,
.panel-switch a,
.panel-switch button {
    color: var(--login-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-options a:hover,
.panel-switch a:hover,
.panel-switch button:hover {
    color: #005ccc;
}

.form-status {
    min-height: 18px;
    margin: 3px 0 0;
    color: var(--login-muted);
    font-size: 13px;
    line-height: 18px;
    text-align: right;
}

.primary-button {
    width: 100%;
    height: clamp(44px, 5.6vh, 57px);
    border: 0;
    border-radius: 10px;
    color: var(--login-text);
    background: var(--login-gold);
    font-size: clamp(16px, 2vh, 20px);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, transform 80ms ease;
}

.primary-button:hover {
    background: var(--login-gold-hover);
}

.primary-button:active {
    transform: translateY(1px);
}

.primary-button:focus-visible,
.panel-switch a:focus-visible,
.panel-switch button:focus-visible,
.form-options a:focus-visible {
    outline: 3px solid rgba(0, 119, 255, 0.34);
    outline-offset: 3px;
}

.panel-switch {
    margin: clamp(16px, 3.6vh, 38px) 0 0;
    color: #000000;
    font-size: clamp(15px, 1.8vh, 18px);
    line-height: 1.4;
    text-align: center;
}

.panel-switch a,
.panel-switch button {
    padding: 0;
    border: 0;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.assurance-strip {
    display: block;
    width: min(897px, calc(100vw - 48px));
    height: auto;
    flex: 0 0 auto;
}

.signup-panel {
    margin-top: 0;
}

.signup-header {
    margin-top: 20px;
}

.signup-header h1 {
    font-size: 30px;
}

.signup-header p {
    margin-top: 8px;
    font-size: 16px;
}

.signup-form {
    display: grid;
    gap: 11px;
    margin-top: 22px;
}

.compact-field label {
    display: block;
    margin: 0 0 5px;
    color: var(--login-muted);
    font-size: 14px;
    font-weight: 500;
}

.compact-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--login-border);
    border-radius: 5px;
    outline: none;
    color: var(--login-text);
    background: var(--login-white);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.signup-form .primary-button {
    height: 48px;
    margin-top: 3px;
    font-size: 18px;
}

.signup-panel .panel-switch {
    margin-top: 18px;
    font-size: 16px;
}

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

@media (max-width: 700px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow: auto;
    }

    .auth-shell {
        min-height: 100dvh;
        height: auto;
        justify-content: center;
        gap: 24px;
        padding: 24px 16px;
    }

    .auth-card {
        width: 100%;
        max-height: none;
        padding: 38px 28px 32px;
    }

    .auth-logo {
        width: 230px;
        max-width: 82%;
    }

    .auth-header {
        margin-top: 24px;
    }

    .auth-header h1 {
        font-size: 29px;
    }

    .auth-header p {
        margin-top: 10px;
        font-size: 15px;
    }

    .auth-form {
        margin-top: 30px;
    }

    .form-field input {
        height: 58px;
        padding-left: 46px;
        font-size: 16px;
    }

    .field-icon,
    .password-toggle {
        top: 17px;
    }

    .form-options {
        margin-top: 18px;
        font-size: 14px;
    }

    .primary-button {
        height: 52px;
        font-size: 18px;
    }

    .panel-switch {
        margin-top: 24px;
        font-size: 15px;
    }

    .assurance-strip {
        width: min(520px, calc(100vw - 40px));
    }
}

@media (max-width: 460px) {
    .auth-card {
        padding-right: 20px;
        padding-left: 20px;
    }

    .auth-logo {
        width: 205px;
    }

    .form-options {
        align-items: flex-start;
        gap: 12px;
    }

    .assurance-strip {
        display: none;
    }
}

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