html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(to bottom, #4a9452, #cde7d0, #ffffff);
    background-attachment: fixed;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5.5rem 1rem 2rem;
}

.auth-brand {
    margin-bottom: 0.5rem;
}

.auth-card {
    width: min(100%, 720px);
    max-width: 720px;
    border-radius: 14px;
}

.auth-logo {
    width: 15%;
    height: 15%;
    object-fit: contain;
}

.form-label {
    font-weight: 600;
    font-size: 14px;
}

.required-indicator {
    display: inline-block;
    margin-left: 0.18rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: text-top;
}

.required-fields-note {
    margin-top: 0.65rem;
    color: #6c757d;
    font-size: 0.82rem;
    line-height: 1.4;
}

.form-text-muted {
    font-size: 12px;
    color: #6c757d;
}

.form-control,
.form-select {
    border-radius: 0.55rem;
}

.birthdate-picker {
    position: relative;
}

.birthdate-input-group {
    position: relative;
}

.birthdate-input-group .form-control,
.birthdate-picker-toggle {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.birthdate-input-group .form-control {
    position: relative;
    z-index: 2;
    background-color: transparent;
}

.birthdate-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.birthdate-display::placeholder {
    color: transparent;
}

.birthdate-guide {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    right: 3.35rem;
    z-index: 1;
    transform: translateY(-50%);
    color: #98a2b3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    white-space: pre;
    pointer-events: none;
    user-select: none;
}

.birthdate-guide:empty {
    display: none;
}

.birthdate-picker-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    position: relative;
    z-index: 3;
    border: 1px solid #ced4da;
    background-color: #ffffff;
    color: #4a9452;
}

.birthdate-picker-toggle:hover,
.birthdate-picker-toggle:focus,
.birthdate-picker.is-open .birthdate-picker-toggle {
    background-color: #f4fbf5;
    color: #2f6b39;
}

.birthdate-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 30;
    width: max(100%, 320px);
    max-width: min(92vw, 360px);
    padding: 0.9rem;
    border: 1px solid #dde5df;
    border-radius: 14px;
    background-color: #ffffff;
    box-shadow: 0 18px 36px rgba(16, 24, 40, 0.16);
}

.birthdate-panel[hidden] {
    display: none !important;
}

.birthdate-panel-header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.birthdate-selectors {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.5rem;
}

.birthdate-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d7e2d9;
    border-radius: 10px;
    background-color: #ffffff;
    color: #335f3b;
}

.birthdate-nav-button:hover:not(:disabled),
.birthdate-nav-button:focus-visible:not(:disabled) {
    background-color: #eef8f0;
    color: #234f2b;
}

.birthdate-nav-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.birthdate-weekdays,
.birthdate-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.birthdate-weekdays {
    margin-bottom: 0.45rem;
}

.birthdate-weekdays span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
}

.birthdate-day {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    background-color: #f6f8f7;
    color: #1f2937;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
        transform 0.15s ease;
}

.birthdate-day:hover:not(:disabled),
.birthdate-day:focus-visible:not(:disabled) {
    background-color: #e8f3ea;
    border-color: #b8d7bf;
    color: #234f2b;
    transform: translateY(-1px);
}

.birthdate-day.is-outside {
    background-color: #fbfcfb;
    color: #98a2b3;
}

.birthdate-day.is-today {
    border-color: #b8d7bf;
}

.birthdate-day.is-selected {
    background-color: #4a9452;
    border-color: #4a9452;
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(74, 148, 82, 0.24);
}

.birthdate-day:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.birthdate-panel-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.birthdate-clear-button {
    border: none;
    background: none;
    padding: 0;
    color: #4a9452;
    font-size: 0.85rem;
    font-weight: 600;
}

.birthdate-clear-button:hover,
.birthdate-clear-button:focus {
    color: #2f6b39;
    text-decoration: underline;
}

.password-toggle-wrapper .form-control {
    padding-right: 2.75rem;
}

.contact-method-guidance {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.25rem 0 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #b8d7bf;
    border-left: 4px solid #4a9452;
    border-radius: 0.55rem;
    background-color: #f4fbf5;
    color: #1f3d2a;
    font-size: 0.95rem;
    line-height: 1.45;
}

.contact-method-guidance i {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    color: #3c8146;
    font-size: 1rem;
}

.verification-method-shell {
    margin-top: -0.1rem;
}

.verification-method-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ced4da;
    border-radius: 0.55rem;
    background-color: #ffffff;
}

.verification-method-panel.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.1);
}

.verification-method-options {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
}

.verification-method-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
}

.verification-method-label {
    flex: 0 0 auto;
    margin: 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.verification-method-label .required-indicator {
    margin-left: 0.22rem;
}

.verification-method-option .form-check-input {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
    transform: scale(0.92);
}

.verification-method-option span {
    line-height: 1.2;
}

.verification-method-help {
    display: block;
    margin-top: 0.35rem;
    padding-inline: 0.15rem;
    font-size: 0.8rem;
    line-height: 1.35;
}

.contact-method-error {
    margin-top: 0.35rem;
}

.verification-method-error {
    margin-top: 0.2rem;
}

.auth-field-error-list {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.35rem;
}

.beneficiary-address-error {
    margin-top: 0.35rem;
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.1);
}

.password-guidelines {
    margin-top: 0.55rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #e0e7e2;
    border-radius: 0.75rem;
    background: #f8fbf8;
}

.password-guidelines-title {
    margin-bottom: 0.45rem;
    color: #355f3b;
    font-size: 0.84rem;
    font-weight: 700;
}

.password-requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.password-requirement-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.password-requirement-icon {
    width: 1rem;
    flex: 0 0 1rem;
    font-weight: 700;
}

.password-requirement-item.is-met {
    color: #2f6b39;
}

.password-requirement-item.is-unmet {
    color: #6b7280;
}

.terms-consent {
    padding: 0;
    border: 0;
    background: transparent;
}

.terms-consent.is-invalid .form-check-input {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.08);
}

.terms-consent-line {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    color: #343a40;
    font-size: 0.88rem;
    line-height: 1.45;
}

.terms-consent-line .form-check-input {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin: 0.15rem 0 0;
}

.terms-consent-copy {
    min-width: 0;
}

.terms-consent-copy .form-check-label {
    display: inline;
    margin: 0;
    color: inherit;
    font-weight: 400;
}

.terms-link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1f6f3d;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    cursor: pointer;
}

.terms-link-button:hover,
.terms-link-button:focus-visible {
    color: #198754;
}

.terms-dialog {
    width: min(94vw, 760px);
    max-height: min(88vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1f2937;
}

.terms-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.terms-dialog-card {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 760px);
    border: 1px solid #2f2f2f;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.terms-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.terms-dialog-kicker {
    color: #1f3d2a;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.terms-dialog-title {
    margin: 0;
    color: #1f3d2a;
    font-size: 1.35rem;
    font-weight: 800;
}

.terms-dialog-updated {
    margin: 0.35rem 0 0;
    color: #6b7280;
    font-size: 0.88rem;
}

.terms-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dce8df;
    border-radius: 999px;
    background: #ffffff;
    color: #4b5563;
}

.terms-dialog-close:hover,
.terms-dialog-close:focus-visible {
    background: #f0f8f2;
    color: #198754;
}

.terms-dialog-body {
    max-height: min(60vh, 430px);
    margin: 1rem;
    padding: 0;
    border: 1px solid #d6d6d6;
    background: #ffffff;
    overflow: auto;
}

.terms-document {
    min-width: 100%;
    padding: 1rem 1.15rem;
    font-size: 1rem;
    line-height: 1.7;
}

.terms-document h3 {
    margin: 1.15rem 0 0.45rem;
    color: #1f3d2a;
    font-size: 1rem;
    font-weight: 800;
}

.terms-document h3:first-child {
    margin-top: 0;
}

.terms-document p,
.terms-document ul {
    margin-bottom: 0.8rem;
}

.terms-document ul {
    padding-left: 1.25rem;
}

.terms-dialog-footer {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dee2e6;
    background: #ffffff;
}

.btn-create {
    background-color: #4a9452;
    border: none;
}

.btn-create:disabled {
    background-color: #8fb895;
    opacity: 0.72;
    cursor: not-allowed;
}

.btn-create:hover:not(:disabled) {
    background-color: #3d7a43;
}

small.text-center a {
    text-decoration: none;
    color: #6c757d;
}

small.text-center a:hover {
    text-decoration: underline;
    color: #4a9452;
}

.auth-back-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: #ffffff;
    color: #1a4d2e;
    border-radius: 999px;
    border: 1px solid #cfe8d8;
    font-size: 14px;
    padding: 0.6rem 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(16, 24, 40, 0.1);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.auth-back-btn i {
    font-size: 0.95rem;
}

.auth-back-btn:hover {
    background-color: #f7fcf8;
    border-color: #a8d5be;
    box-shadow: 0 16px 28px rgba(16, 24, 40, 0.14);
    transform: translateY(-1px);
}

@media (max-width: 576px) {
    .auth-page {
        padding: 4.8rem 0.75rem 1.5rem;
    }

    .birthdate-panel {
        width: 100%;
        max-width: none;
        padding: 0.8rem;
    }

    .birthdate-day {
        min-height: 36px;
        font-size: 0.88rem;
    }

    .verification-method-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .verification-method-options {
        gap: 0.75rem;
    }

    .password-guidelines {
        padding: 0.7rem 0.75rem;
    }

    .terms-dialog-body {
        margin: 0.75rem;
        max-height: min(58vh, 420px);
    }

    .terms-document {
        padding: 0.85rem;
        font-size: 0.95rem;
    }

    .auth-logo {
        width: 72px;
        height: 72px;
    }

    .auth-back-btn {
        font-size: 12px;
        padding: 0.5rem 0.85rem;
    }
}
