:root {
    --auth-background: linear-gradient(180deg, #f6f8fb 0%, #eef1f7 100%);
    --auth-card-background: #ffffff;
    --auth-card-border: rgba(15, 23, 42, 0.08);
    --auth-card-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
    --auth-text: #1f2937;
    --auth-muted: #6b7280;
    --auth-accent: #007c89;
    --auth-accent-hover: #006470;
    --auth-success: #0f9d58;
    --auth-error: #dc2626;
    --auth-border: #d8dee6;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3rem) 1.5rem;
    background: var(--auth-background);
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--auth-text);
}

.auth-shell {
    width: min(360px, 100%);
    margin: 0 auto;
}

.auth-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-card {
    background: var(--auth-card-background);
    border-radius: 20px;
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    padding: clamp(2.25rem, 5vw, 2.75rem);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: min(360px, 100%);
    margin: 0 auto;
}

.auth-view {
    display: none;
    flex-direction: column;
    gap: 1.75rem;
}

.auth-view.is-active {
    display: flex;
}

.auth-card__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    color: var(--auth-text);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-card__logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0091a7, #00b5ad);
    color: #ffffff;
}

.auth-card__brand-text {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--auth-muted);
}

.auth-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.auth-card__title {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    font-weight: 700;
    color: var(--auth-text);
}

.auth-card__subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--auth-muted);
}

.auth-card__link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-card__link:hover,
.auth-card__link:focus {
    color: var(--auth-accent-hover);
    outline: none;
}

.auth-card__description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--auth-muted);
}

.auth-legal {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--auth-muted);
}

.auth-legal--inline {
    text-align: center;
}

.auth-legal a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-legal a:hover,
.auth-legal a:focus {
    color: var(--auth-accent-hover);
    outline: none;
}

.auth-alert {
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
}

.auth-alert--error {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--auth-error);
}

.auth-alert--success {
    background: rgba(15, 157, 88, 0.08);
    border: 1px solid rgba(15, 157, 88, 0.18);
    color: var(--auth-success);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.auth-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.auth-input {
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--auth-border);
    border-radius: 0.75rem;
    font-size: 1rem;
    background-color: #f9fbfd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.18);
    background-color: #ffffff;
}

.auth-feedback {
    font-size: 0.85rem;
    color: var(--auth-error);
}

.auth-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.auth-consent {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-consent__label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    line-height: 1.5;
}

.auth-consent__checkbox {
    width: 1rem;
    height: 1rem;
    margin-top: 0.25rem;
}

.auth-consent__text a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-consent__text a:hover,
.auth-consent__text a:focus {
    color: var(--auth-accent-hover);
    text-decoration: underline;
    outline: none;
}

.auth-switch {
    background: none;
    border: none;
    padding: 0 0 0.2rem;
    margin: 0;
    color: var(--auth-accent);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}

.auth-switch:hover,
.auth-switch:focus {
    color: var(--auth-accent-hover);
    outline: none;
    text-decoration: underline;
}

.auth-switch--inline {
    font-size: 0.9rem;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1rem 1rem;
    border-radius: 999px;
    border: none;
    background: var(--auth-accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-button:hover,
.auth-button:focus {
    background: var(--auth-accent-hover);
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 16px 24px rgba(0, 124, 137, 0.25);
}

.auth-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.auth-button__spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    animation: auth-spin 0.9s linear infinite;
}

.auth-button.is-loading .auth-button__spinner {
    display: inline-flex;
}

.auth-button.is-loading .auth-button__text {
    opacity: 0.85;
}

@keyframes auth-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.auth-meta {
    font-size: 0.85rem;
    color: var(--auth-muted);
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
    margin-top: 1.5rem;
}

.auth-links--split {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auth-links a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-links a:hover,
.auth-links a:focus {
    color: var(--auth-accent-hover);
    outline: none;
}

@media (max-width: 520px) {
    body.auth-body {
        padding: 1.75rem 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 18px;
    }
}
