/* Allauth Theme Styles - Applied to all allauth pages via layout templates */

/* Links - Make visible on dark theme */
.card a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.card a:hover {
    color: var(--color-accent-light);
    text-decoration: underline;
}

.card a:visited {
    color: var(--color-accent-light);
}

/* Lists - Style UL elements used in allauth */
.card ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.card ul li {
    margin: 0.5rem 0;
    padding-left: 0;
}

.card ul li a {
    display: inline-block;
    padding: 0.25rem 0;
}

/* Nested lists */
.card ul ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.card ul ul li {
    margin: 0.25rem 0;
}

/* Buttons rendered via allauth elements */
.card button,
.card input[type="submit"],
.card input[type="button"] {
    background: var(--color-accent);
    color: var(--color-text-light);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.card button:hover,
.card input[type="submit"]:hover,
.card input[type="button"]:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

/* Form elements */
.card input[type="text"],
.card input[type="email"],
.card input[type="password"],
.card input[type="number"],
.card textarea,
.card select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.card input[type="text"]:focus,
.card input[type="email"]:focus,
.card input[type="password"]:focus,
.card input[type="number"]:focus,
.card textarea:focus,
.card select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Labels */
.card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* Error messages and alerts */
.card .errorlist,
.card .alert {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid var(--color-error);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    list-style: none;
}

.card .errorlist li {
    margin: 0.25rem 0;
}

/* Paragraphs and text */
.card p {
    color: var(--color-text-primary);
    margin: 1rem 0;
    line-height: 1.6;
}

/* Headings */
.card h1,
.card h2,
.card h3 {
    color: var(--color-text-secondary);
    margin: 1.5rem 0 1rem 0;
}

.card h1 {
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.75rem;
}

/* Entrance pages (login / signup / password reset): a centered column,
   not a card spanning the whole viewport. */
.entrance-card {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 4rem auto;
    padding: 2rem 1.75rem;
}

/* Backdrop for entrance pages: a hairline grid in the theme's border color with a
   violet glow behind the card — fixed, behind everything, never intercepts clicks. */
.entrance-bg {
    position: fixed;
    inset: 0;
    /* Behind all in-flow content (the header's own background covers it) but still
       above the body background. */
    z-index: -1;
    pointer-events: none;
    /* The grid is dimmed via color-mix instead of an opacity on the container, so the
       beams below can run at full intensity. */
    background-image:
        radial-gradient(700px 380px at 50% 12%, rgba(139, 92, 246, 0.14), transparent 70%),
        linear-gradient(color-mix(in srgb, var(--color-border) 55%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--color-border) 55%, transparent) 1px, transparent 1px);
    background-size: auto, 44px 44px, 44px 44px;
    /* Fade the grid out toward the edges so it frames the card instead of wallpapering. */
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 35%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 35%, transparent 80%);
}

/* Animated beams: short violet light segments traveling along the grid lines.
   Two via pseudo-elements, two via the <i> children — different lanes and timings so
   the pattern never reads as a loop. All sit on 44px multiples to ride the grid. */
.entrance-bg::before,
.entrance-bg::after,
.entrance-bg i {
    content: "";
    position: absolute;
    display: block;
}

.entrance-bg::before,
.entrance-bg i:first-child {
    height: 2px;
    width: 220px;
    left: -220px;
    background: linear-gradient(90deg, transparent, #c4b5fd, transparent);
    box-shadow: 0 0 12px 1px rgba(139, 92, 246, 0.7);
    animation: entrance-beam-x 9s linear infinite;
}

.entrance-bg::after,
.entrance-bg i:last-child {
    width: 2px;
    height: 220px;
    top: -220px;
    background: linear-gradient(180deg, transparent, #c4b5fd, transparent);
    box-shadow: 0 0 12px 1px rgba(139, 92, 246, 0.7);
    animation: entrance-beam-y 12s linear infinite;
}

.entrance-bg::before      { top: calc(44px * 4); }
.entrance-bg i:first-child { top: calc(44px * 13); animation-delay: 4.5s; animation-duration: 11s; }
.entrance-bg::after       { left: calc(44px * 5); animation-delay: 2s; }
.entrance-bg i:last-child  { left: calc(44px * 18); animation-delay: 7s; animation-duration: 10s; }

@keyframes entrance-beam-x {
    to { transform: translateX(calc(100vw + 440px)); }
}

@keyframes entrance-beam-y {
    to { transform: translateY(calc(100vh + 440px)); }
}

@media (prefers-reduced-motion: reduce) {
    .entrance-bg::before,
    .entrance-bg::after,
    .entrance-bg i {
        animation: none;
        display: none;
    }
}

/* Compact typography inside the entrance card — the stock allauth sizes read oversized. */
.entrance-card h1 {
    font-size: 1.4rem;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.entrance-card h1::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 3px;
    margin-top: 0.6rem;
    border-radius: 2px;
    background: var(--color-accent-gradient, var(--color-accent));
}

.entrance-card p {
    font-size: 0.9rem;
    margin: 0.75rem 0 1rem;
}

.entrance-card label {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.entrance-card input[type="text"],
.entrance-card input[type="email"],
.entrance-card input[type="password"],
.entrance-card input[type="number"] {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
}

.entrance-card form {
    margin-top: 1.25rem;
}

.entrance-card button[type="submit"] {
    width: 100%;
    margin-top: 0.75rem;
}

/* Divider between the credentials form and the SSO providers */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* SSO provider buttons */
.card ul.provider-list {
    margin: 0;
}

.card .provider-list li {
    margin: 0.5rem 0;
}

.card a.provider-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card a.provider-btn:hover,
.card a.provider-btn:visited {
    color: var(--color-text-secondary);
}

.card a.provider-btn:hover {
    border-color: var(--color-border-focus);
    background: var(--color-accent-soft, rgba(139, 92, 246, 0.12));
    text-decoration: none;
    transform: translateY(-1px);
}

.provider-btn .provider-icon {
    flex: none;
}

.provider-btn .provider-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #94a3b8);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

/* Tables (if used) */
.card table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.card table th,
.card table td {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.card table th {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    font-weight: 600;
}

