html,
body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--primary-color-dark), var(--primary-color));
    color: var(--white-color);
    position: relative;
    overflow: hidden;
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
    height: 100vh;
}

.auth-visual {
    flex: 1;
    background: var(--primary-color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-visual picture,
.auth-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    height: 100vh;
}

.auth-panel {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    color: var(--white-color);
}

.auth-panel h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.2;
    font-weight: 700;
    margin: 0;
}

.auth-heading-highlight {
    color: var(--secondary-color);
}

.auth-description {
    color: var(--white-transparent-90);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.auth-top-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: var(--white-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.auth-link-button:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
    border-color: transparent;
}

.auth-note {
    color: var(--white-transparent-90);
    font-size: 0.95rem;
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-input {
    width: 100%;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    color: var(--primary-color);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-input::placeholder {
    color: rgba(51, 51, 51, 0.6);
}

.auth-input:focus {
    outline: none;
    border-color: var(--tertiary-color);
    box-shadow: 0 0 0 4px var(--tertiary-color-transparent-20);
}

.auth-panel .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--white-color);
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 18px 45px -30px var(--primary-color-shadow-dark);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.auth-panel .btn-primary:hover {
    background: var(--secondary-color);
    color: var(--white-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.auth-panel .auth-cta-button {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--white-color);
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 18px 45px -30px var(--primary-color-shadow-dark);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.auth-panel .auth-cta-button:hover {
    background: var(--secondary-color);
    color: var(--white-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--light-border);
}

.divider span {
    padding: 0 10px;
    color: var(--light-text-secondary);
    font-size: 0.875rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 1px solid var(--light-border);
    border-radius: 0.5rem;
    background-color: var(--white-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.google-btn:hover {
    background-color: var(--light-input-bg);
    border-color: var(--dark-text-secondary);
    transform: translateY(-1px);
}

.auth-panel .google-btn {
    gap: 0.65rem;
}

.auth-panel .google-btn img {
    width: 24px;
    height: 24px;
}

.auth-panel .google-btn span {
    color: inherit;
}

.input-error {
    color: var(--cancel-red);
    font-size: 0.825rem;
    margin-top: 0.35rem;
}

.auth-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-message {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: var(--white-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-message.error,
.auth-message.warning {
    border-color: var(--cancel-red);
    color: var(--cancel-red);
}

.auth-message.success {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.auth-message.info {
    border-color: var(--tertiary-color);
    color: var(--tertiary-color);
}

.consent-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.racepace-consent-text {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: var(--white-transparent-90);
}

.racepace-consent-text input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--secondary-color);
}

.racepace-consent-text a {
    color: var(--secondary-color);
    text-decoration: underline;
    font-weight: 600;
}

.racepace-consent-text a:hover {
    color: var(--secondary-color-dark);
}

.auth-panel .divider {
    margin: 1.5rem 0 0.75rem;
}

.auth-panel .divider::before,
.auth-panel .divider::after {
    border-bottom-color: rgba(255, 255, 255, 0.35);
}

.auth-panel .divider span {
    color: var(--white-transparent-90);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-support-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    color: var(--white-transparent-90);
    font-size: 0.95rem;
}

.auth-support-links a:not(.auth-cta-button) {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-support-links a:not(.auth-cta-button):hover {
    color: var(--secondary-color-dark);
    text-decoration: underline;
}

.auth-support-links .auth-cta-button {
    align-self: center;
    text-decoration: none;
}

.racepace-terms-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: racepaceModalFadeIn 0.3s;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.racepace-modal-content {
    background: var(--dark-card-bg);
    border: 1px solid var(--dark-card-border);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: racepaceModalSlideIn 0.3s;
    padding: clamp(1.75rem, 4vw, 2.5rem);
    border-radius: 18px;
    box-shadow: 0 24px 65px -30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
}

.racepace-modal-content h2 {
    color: var(--dark-text-primary);
}

.racepace-modal-text {
    color: var(--dark-text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.racepace-modal-text p {
    color: var(--dark-text-secondary);
}

.racepace-modal-text strong {
    color: var(--dark-text-primary);
}

.racepace-modal-text em {
    color: var(--dark-text-secondary);
}

.racepace-modal-content .btn-secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid var(--secondary-color);
}

.racepace-modal-content .btn-secondary:hover {
    background: var(--secondary-color-dark);
    border-color: var(--secondary-color-dark);
    transform: translateY(-1px);
}

.racepace-modal-text p {
    margin-bottom: 1.5rem;
}

@keyframes racepaceModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes racepaceModalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .racepace-modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 1024px) {
    body.auth-body {
        overflow-y: auto;
    }

    .auth-wrapper {
        flex-direction: column;
        height: auto;
    }

    .auth-visual {
        height: 40vh;
    }

    .auth-content {
        padding: 3rem 2rem 4rem;
        height: auto;
    }

    .auth-panel {
        max-width: 520px;
    }
}

@media (max-width: 640px) {
    body.auth-body {
        background: linear-gradient(135deg, var(--primary-color-dark), var(--primary-color));
        color: var(--white-color);
    }

    .auth-wrapper {
        flex-direction: column;
        min-height: 100vh;
        height: auto;
    }

    .auth-visual {
        display: none;
    }

    .auth-content {
        padding: 2.5rem 1.5rem 3rem;
        height: auto;
    }

    .auth-panel {
        max-width: 100%;
        gap: 1.2rem;
    }

    .auth-panel .google-btn {
        padding: 0.75rem 1rem;
    }

    .auth-panel .google-btn img {
        width: 20px;
        height: 20px;
    }
}
