/* Social sign-in cards on /login and /signup: icon, short title, longer description. */
.auth-oauth-cards {
    display: grid;
    grid-template-columns: repeat(var(--oauth-cols, 3), minmax(0, 1fr));
    gap: var(--space-3, 0.75rem);
}

.auth-oauth-card {
    --brand: #4285f4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-4, 1rem);
    min-width: 0;
    text-align: left;
    text-decoration: none;
    color: var(--text-primary, inherit);
    background: var(--bg-surface, transparent);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.35));
    border-radius: var(--radius-lg, 0.75rem);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-oauth-card:hover,
.auth-oauth-card:focus-visible {
    color: var(--text-primary, inherit);
    text-decoration: none;
    transform: translateY(-1px);
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 6%, var(--bg-surface, transparent));
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.15));
}

.auth-oauth-card:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.auth-oauth-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 1.1rem;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border-radius: var(--radius-md, 0.5rem);
}

/* "Last used" pill, top-right of the card the visitor signed in with last time */
.auth-oauth-card {
    position: relative;
}

.auth-oauth-card.is-last {
    border-color: color-mix(in srgb, var(--brand) 55%, transparent);
}

.auth-oauth-card__badge {
    position: absolute;
    top: var(--space-2, 0.5rem);
    right: var(--space-2, 0.5rem);
    padding: 1px 7px;
    font-size: 0.65rem;
    font-weight: var(--font-weight-semibold, 600);
    line-height: 1.5;
    white-space: nowrap;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border-radius: 999px;
}

.auth-oauth-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.auth-oauth-card__title {
    font-weight: var(--font-weight-semibold, 600);
    line-height: 1.2;
}

.auth-oauth-card__desc {
    font-size: var(--font-size-xs, 0.8rem);
    line-height: var(--line-height-snug, 1.35);
    color: var(--text-muted, rgba(128, 128, 128, 0.9));
}

/* Near-black brands (GitHub, X) disappear on dark: use the text colour instead. */
.auth-oauth-card.is-mono {
    --brand: var(--text-primary, #333);
}

/* Phones: one card per row, icon on the left. */
@media (max-width: 420px) {
    .auth-oauth-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-oauth-card {
        flex-direction: row;
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-oauth-card {
        transition: none;
    }

    .auth-oauth-card:hover,
    .auth-oauth-card:focus-visible {
        transform: none;
    }
}
