.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 14, 37, 0.58);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-card {
    position: relative;
    width: min(100%, 560px);
    max-height: min(92vh, 820px);
    overflow-y: auto;
    padding: 28px 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 254, 0.96));
    box-shadow: 0 24px 60px rgba(4, 14, 37, 0.22);
    transform: translateY(12px) scale(0.98);
    transition: transform 220ms ease;
}

.modal-backdrop.is-open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(4, 14, 37, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--brand-navy);
    cursor: pointer;
}

.modal-header {
    margin-bottom: 24px;
    padding-right: 44px;
}

.modal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.modal-title {
    margin: 0;
    font-size: clamp(0.75rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.modal-description {
    margin: 14px 0 0;
    color: var(--neutral-700);
    font-size: 0.95rem;
    line-height: 1.65;
}

.auth-view.is-hidden {
    display: none;
}

.auth-notice {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.auth-notice--info {
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(37, 99, 235, 0.08);
    color: var(--brand-blue);
}

.auth-response {
    display: none;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.auth-response.is-visible {
    display: block;
}

.auth-response.is-success {
    border: 1px solid rgba(22, 163, 74, 0.18);
    background: rgba(22, 163, 74, 0.08);
    color: #0f7a32;
}

.auth-response.is-error {
    border: 1px solid rgba(220, 38, 38, 0.16);
    background: rgba(220, 38, 38, 0.08);
    color: #b42318;
}

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

.form-field {
    display: grid;
    gap: 10px;
}

.form-field.is-invalid .input-shell,
.form-field.is-invalid .field-textarea {
    border-color: rgba(220, 38, 38, 0.28);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid rgba(4, 14, 37, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-shell-checkbox{
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
}

.input-shell:focus-within,
.field-textarea:focus {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-shell input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--brand-navy);
    font-size: 0.95rem;
    font-family: var(--font-base);
}

.input-shell input::placeholder,
.field-textarea::placeholder {
    color: var(--neutral-500);
}

.field-textarea {
    width: 100%;
    min-height: 108px;
    padding: 16px;
    border: 1px solid rgba(4, 14, 37, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-navy);
    font-size: 0.95rem;
    font-family: var(--font-base);
    resize: vertical;
    outline: 0;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.password-toggle img {
    width: 22px;
    height: 22px;
}

.field-help {
    color: var(--neutral-700);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.field-error {
    display: none;
    color: #b42318;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.form-field.is-invalid .field-error {
    display: block;
}

.field-grid {
    display: grid;
    gap: 18px;
}

.modal-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -2px;
}

.text-link {
    color: var(--brand-blue);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.modal-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(4, 14, 37, 0.08);
    color: var(--neutral-700);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
}

.modal-footer a,
.modal-footer button {
    color: var(--brand-blue);
    font-weight: 700;
}

.auth-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.auth-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    color: var(--neutral-700);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(4, 14, 37, 0.06);
    color: var(--brand-navy);
    font-size: 0.75rem;
    font-weight: 700;
}

.auth-page {
    min-height: 100vh;
}

.auth-page-shell {
    width: min(100%, var(--page-width));
    margin: 0 auto;
    padding: 32px var(--page-padding) 48px;
}

.auth-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    max-width: 640px;
    margin-inline: auto;
}

.auth-page-brand img {
    width: clamp(156px, 14vw, 204px);
}

.auth-page-main {
    display: flex;
    justify-content: center;
    align-items: start;
}

.auth-highlight,
.auth-register-card {
    width: min(100%, 640px);
    padding: 24px;
    border: 1px solid rgba(4, 14, 37, 0.08);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 254, 0.96));
    box-shadow: 0 24px 60px rgba(4, 14, 37, 0.12);
}

.auth-highlight {
    position: relative;
    overflow: hidden;
}

.auth-highlight::after {
    content: "";
    position: absolute;
    right: -48px;
    bottom: -48px;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    background: rgba(254, 165, 1, 0.14);
    filter: blur(8px);
}

.auth-highlight-content,
.auth-register-card {
    position: relative;
    z-index: 1;
}

.auth-highlight-title {
    margin: 12px 0 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.auth-highlight-description {
    margin: 18px 0 0;
    max-width: 560px;
    color: var(--neutral-700);
    font-size: 1rem;
    line-height: 1.75;
}

.auth-highlight-list {
    display: grid;
    gap: 14px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.auth-highlight-list li {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: start;
}

.auth-highlight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.3));
}

.auth-highlight-icon img {
    width: 18px;
    height: 18px;
}

.auth-highlight-list strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.auth-highlight-list span {
    color: var(--neutral-700);
    font-size: 0.875rem;
    line-height: 1.55;
}

.auth-register-card .modal-header {
    margin-bottom: 20px;
    padding-right: 0;
}

.auth-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-blue);
    font-size: 0.95rem;
    font-weight: 700;
}

.checkbox-shell {
    align-items: flex-start;
    padding-block: 14px;
}

.checkbox-shell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-blue);
    flex: 0 0 auto;
}

.checkbox-shell span {
    color: var(--neutral-700);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .modal-card {
        padding: 32px;
    }

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

    .field-grid .form-field--full {
        grid-column: 1 / -1;
    }

    .auth-page-shell {
        padding-top: 40px;
        padding-bottom: 56px;
    }

    .auth-page-main {
        grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
        gap: 28px;
    }

    .auth-highlight,
    .auth-register-card {
        padding: 32px;
    }
}
