/* Common form styles */
@import "forms-vyzZNVS.css";

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 150px); /* Adjust footer height if needed */
    padding: 2rem 1rem;
}

.form-card {
    width: 100%;
    max-width: 420px;
}

.form-card h1 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.form-card .auth-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    margin: 2rem 0;
}

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

.divider:not(:empty)::before {
    margin-right: .5em;
}

.divider:not(:empty)::after {
    margin-left: .5em;
}

.auth-form > .divider {
    margin: 1.25rem 0 1rem;
}

.social-logins-row {
    --social-icon-btn-bg: #172443;
    --social-icon-btn-border: color-mix(in srgb, #172443 72%, #ffffff 28%);
    --social-icon-btn-hover-bg: color-mix(in srgb, #172443 88%, #ffffff 12%);
    --social-icon-btn-shadow: 0 4px 14px color-mix(in srgb, #172443 45%, transparent);

    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

html[data-bs-theme='light'] .social-logins-row {
    --social-icon-btn-bg: #eef2f8;
    --social-icon-btn-border: color-mix(in srgb, #172443 18%, transparent);
    --social-icon-btn-hover-bg: #e2e8f2;
    --social-icon-btn-shadow: 0 4px 12px color-mix(in srgb, #172443 12%, transparent);
}

.social-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--social-icon-btn-border);
    background-color: var(--social-icon-btn-bg);
    color: var(--color-text-primary);
    box-shadow: var(--social-icon-btn-shadow);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.social-icon-btn:hover {
    background-color: var(--social-icon-btn-hover-bg);
    border-color: color-mix(in srgb, var(--social-icon-btn-border) 80%, #ffffff 20%);
    color: var(--color-text-primary);
    box-shadow: 0 6px 18px color-mix(in srgb, #172443 35%, transparent);
}

.social-icon-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.social-icon-btn--telegram {
    overflow: visible;
}

.social-icon-btn__visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.social-icon-btn--telegram .social-icon-btn__visual {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 0;
}

.social-icon-btn__visual svg {
    width: 24px;
    height: 24px;
}

.social-icon-btn--telegram .social-icon-btn__visual {
    font-size: 1.85rem;
    line-height: 1;
    color: #229ED9;
}

.social-icon-btn__widget-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 1;
    width: 240px;
    height: 100%;
    transform: translateX(-50%);
    pointer-events: none;
}

.social-icon-btn--telegram .social-icon-btn__widget-overlay {
    left: calc(50% - 120px);
    z-index: 2;
    transform: none;
    /* Keep the 240px frame (Telegram rejects a clipped widget) but only the 48px icon receives touches. */
    clip-path: inset(0 96px round 10px);
}

.social-icon-btn__widget-overlay iframe {
    display: block;
    width: 100% !important;
    height: 100% !important;
    /* Below 0.1 the widget script treats the iframe as hidden and ignores taps. */
    opacity: 0.1;
    cursor: pointer;
    border: 0;
    pointer-events: auto;
}

.social-icon-btn--telegram .social-icon-btn__widget-overlay iframe {
    mix-blend-mode: multiply;
}

.social-icon-btn__mobile-auth {
    display: none;
}

@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .social-icon-btn__mobile-auth {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 4;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        touch-action: manipulation;
    }
}

.social-icon-btn__consent-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.social-icon-btn__consent-gate:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.auth-social-hint {
    text-align: center;
    line-height: 1.45;
}

.social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    transition: background-color 0.2s, border-color 0.2s;
    margin-bottom: 1rem;
}

.social-login-btn:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary-hover);
}

.social-login-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.telegram-widget-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-footer-link {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.auth-footer-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

.agree-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 0.25rem 0 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    scroll-margin-top: calc(var(--header-height) + 1.25rem);
    scroll-margin-bottom: 2.5rem;
}

.agree-terms--attention {
    border-color: var(--color-danger);
    animation: agree-terms-attention 0.6s ease;
}

@keyframes agree-terms-attention {
    0%,
    100% {
        border-color: var(--color-danger);
    }

    50% {
        border-color: var(--color-border);
    }
}

@media (prefers-reduced-motion: reduce) {
    .agree-terms--attention {
        animation: none;
    }
}

.agree-terms input {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0.15rem 0 0;
    flex: 0 0 auto;
    accent-color: var(--color-primary);
}

.agree-terms label {
    flex: 1;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--color-text-primary);
}

.agree-terms ul,
.agree-terms .invalid-feedback {
    flex-basis: 100%;
    margin: 0;
}

.agree-terms label a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.agree-terms label a:hover,
.agree-terms label a:focus {
    color: var(--color-primary);
    text-decoration-thickness: 2px;
}
