/* Shared sign-in/sign-up shell. The widget must shrink with the viewport;
   hiding page overflow would only conceal clipped inputs and buttons. */
.auth-page {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 120px 24px 64px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    min-width: 0;
    text-align: center;
}

.auth-header { margin-bottom: 28px; }
.auth-header img { height: 48px; margin-bottom: 20px; }
.auth-header h1 { font-size: 2rem; margin-bottom: 12px; }
.auth-header p { color: var(--text-secondary); font-size: 1.0625rem; line-height: 1.6; }

#clerk-signin,
#clerk-signup {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 350px;
}

/* Clerk's default card has a fixed width. Constrain the outer box as well
   as the card, including the footer and later verification steps. */
:is(#clerk-signin, #clerk-signup) .cl-rootBox,
:is(#clerk-signin, #clerk-signup) .cl-cardBox,
:is(#clerk-signin, #clerk-signup) .cl-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

:is(#clerk-signin, #clerk-signup) .cl-card { padding: clamp(16px, 5vw, 32px); }
:is(#clerk-signin, #clerk-signup) .cl-headerTitle,
:is(#clerk-signin, #clerk-signup) .cl-headerSubtitle,
:is(#clerk-signin, #clerk-signup) .cl-footerAction,
.auth-footer { overflow-wrap: anywhere; }

/* Light social buttons keep the official black Apple mark and multicolor
   Google mark legible. Magenta remains the primary Continue action. */
:is(#clerk-signin, #clerk-signup) .cl-socialButtonsBlockButton {
    min-height: 48px;
    padding: 12px 16px;
    background: #f4f4f5;
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    color: #0a0a14;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: none;
}

:is(#clerk-signin, #clerk-signup) .cl-socialButtonsBlockButtonText { color: #0a0a14; font-size: inherit; }
:is(#clerk-signin, #clerk-signup) .cl-socialButtonsProviderIcon { filter: none; }
:is(#clerk-signin, #clerk-signup) .cl-socialButtonsBlockButton:hover:not(:disabled) {
    background: #ffffff;
    border-color: var(--magenta);
}
:is(#clerk-signin, #clerk-signup) .cl-socialButtonsBlockButton:active:not(:disabled) { background: #e4e4e7; }
:is(#clerk-signin, #clerk-signup) .cl-formButtonPrimary { min-height: 48px; font-size: 1rem; }
:is(#clerk-signin, #clerk-signup) .cl-formFieldInput:not([type="checkbox"]):not([type="radio"]) {
    min-width: 0;
    min-height: 48px;
    font-size: 1rem;
}
:is(#clerk-signin, #clerk-signup) button:focus-visible,
:is(#clerk-signin, #clerk-signup) a:focus-visible {
    outline: 3px solid var(--magenta);
    outline-offset: 3px;
}
:is(#clerk-signin, #clerk-signup) .cl-formButtonPrimary:focus-visible { outline-color: #ffffff; }

:is(#clerk-signin, #clerk-signup) > .loading-spinner {
    width: 40px;
    height: 40px;
    margin: 140px auto;
    border: 3px solid var(--border-color);
    border-top-color: var(--magenta);
    border-radius: 50%;
    animation: auth-spin 1s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    :is(#clerk-signin, #clerk-signup) > .loading-spinner { animation: none; }
}

.auth-footer { margin-top: 24px; color: var(--text-secondary); font-size: 0.875rem; }
.auth-footer a { color: var(--magenta); }
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .auth-content { padding: 104px 16px 48px; }
    .auth-header h1 { font-size: 1.875rem; }
    .auth-header p { font-size: 1rem; }
}
