/* Compact authentication sizing — layered after login.css */
body { padding: 20px 18px; }
.auth-card { max-width: 720px; padding: 34px 42px 30px; }
.brand { margin-bottom: 22px; }
.brand h1 { font-size: 38px; margin-bottom: 6px; }
.brand p { font-size: 15px; }
.auth-section h2 { font-size: 29px; margin-bottom: 16px; }
.account-type-description { font-size: 16px; margin-bottom: 20px; }
.account-type-grid { gap: 22px; margin-bottom: 20px; }
.account-type-card { min-height: 265px; padding: 22px 18px; gap: 8px; }
.account-type-icon { width: 72px; height: 72px; font-size: 32px; margin-bottom: 5px; }
.account-type-title { font-size: 20px; }
.account-type-subtitle { font-size: 14px; line-height: 1.4; }
.account-type-security { padding-top: 15px; margin-bottom: 17px; font-size: 13px; }
.btn { min-height: 48px; padding: 10px 18px; font-size: 16px; }
.switch-text { margin-top: 17px; font-size: 15px; gap: 5px; }
.signup-details-header { min-height: 52px; margin-bottom: 19px; padding: 0 48px; }
.signup-details-header h2 { font-size: 27px; margin-bottom: 5px; }
.signup-details-header p { font-size: 15px; }
.back-type-btn { width: 38px; height: 38px; font-size: 20px; }
.signup-details-section .auth-form { gap: 12px; }
.input-group { gap: 6px; }
.input-group label { font-size: 15px; }
.input-group input, .organization-field select { height: 48px; border-radius: 12px; padding: 0 14px; font-size: 16px; }
.field-hint { font-size: 12px; }
.checkbox-group { font-size: 14px; }

/* Flash messages are shown as temporary popups instead of inline banners. */
.flash-messages {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px));
    margin: 0;
    z-index: 10050;
    pointer-events: none;
}

.flash {
    padding: 15px 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    animation: flashPopup 5.5s ease forwards;
}

.flash + .flash { margin-top: 10px; }

.flash.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.flash.info,
.flash.message {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes flashPopup {
    0% { opacity: 0; transform: translateY(-14px) scale(0.98); }
    8% { opacity: 1; transform: translateY(0) scale(1); }
    82% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-10px) scale(0.98); visibility: hidden; }
}

@media (max-width: 700px) {
    body { padding: 14px 10px; }
    .auth-card { padding: 26px 22px 24px; }
    .account-type-card { min-height: 195px; }
    .signup-details-header { padding: 0 42px; }
}
@media (max-width: 480px) {
    .auth-card { padding: 22px 16px 20px; }
    .brand h1 { font-size: 32px; }
    .account-type-card { min-height: 180px; }
}

/* =========================================================
   2026 social-auth polish
   Keep the auth flow unchanged; improve visual hierarchy only.
   ========================================================= */

body {
    background:
        radial-gradient(circle at 20% 10%, rgba(37, 99, 235, .14), transparent 34%),
        radial-gradient(circle at 82% 88%, rgba(59, 130, 246, .10), transparent 30%),
        linear-gradient(145deg, #0b1220 0%, #142033 52%, #1f3047 100%);
}

.auth-card {
    max-width: 610px;
    border-radius: 24px;
    padding: 30px 40px 28px;
    border: 1px solid rgba(226, 232, 240, .86);
    box-shadow: 0 28px 80px rgba(2, 8, 23, .34), 0 2px 8px rgba(2, 8, 23, .08);
}

.brand {
    margin-bottom: 18px;
}

.brand h1 {
    font-size: 34px;
    line-height: 1;
    letter-spacing: .08em;
    margin-bottom: 8px;
}

.brand p {
    font-size: 13px;
    color: #7c8ba1;
    font-weight: 600;
    letter-spacing: .01em;
}

.auth-section h2,
.account-type-section h2 {
    font-size: 27px;
    line-height: 1.15;
    margin-bottom: 8px;
    letter-spacing: -.025em;
}

.account-type-description {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: #73839a;
}

.social-auth-stack {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 14px;
}

.social-auth-btn {
    min-height: 52px;
    border-radius: 13px;
    border: 1px solid #d6dde8;
    background: #fff;
    color: #172033;
    font-size: 14px;
    font-weight: 750;
    letter-spacing: -.005em;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.social-auth-btn:hover {
    background: #f8fafc;
    border-color: #b8c4d4;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.social-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .06);
}

.social-auth-icon {
    width: 22px;
    height: 22px;
}

.google-mark {
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    color: transparent;
    background: conic-gradient(from -32deg, #4285f4 0 25%, #34a853 25% 45%, #fbbc05 45% 68%, #ea4335 68% 83%, #4285f4 83% 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.microsoft-mark {
    width: 18px;
    height: 18px;
    gap: 2px;
}

.auth-divider {
    margin: 14px 0 15px;
    gap: 12px;
    color: #94a0b2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .015em;
}

.auth-divider::before,
.auth-divider::after {
    background: #e7ebf1;
}

.auth-form {
    gap: 14px;
}

.input-group {
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    color: #334155;
}

.input-group input,
.organization-field select {
    height: 50px;
    border-radius: 12px;
    border-color: #d8e0ea;
    background: #f8fafc;
    font-size: 15px;
    padding: 0 15px;
}

.input-group input:hover,
.organization-field select:hover {
    border-color: #c2ccda;
}

.input-group input:focus,
.organization-field select:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.btn.primary {
    min-height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f6df6, #2457df);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #2b63e6, #1f4fcf);
    box-shadow: 0 10px 22px rgba(37, 99, 235, .24);
}

.switch-text {
    margin-top: 15px;
    gap: 4px;
    font-size: 13px;
}

.link-btn {
    font-size: 14px;
}

/* Signup: keep the social route prominent while making manual account
   classification compact instead of two oversized tiles. */
.account-type-section {
    display: flex;
    flex-direction: column;
}

.account-type-section > h2 { order: 1; }
.account-type-section > .account-type-description { order: 2; }
.account-type-section > .social-auth-stack { order: 3; }
.account-type-section > .auth-divider { order: 4; }
.account-type-section > .account-type-grid { order: 5; }
.account-type-section > .account-type-security { order: 6; }
.account-type-section > #continueAccountTypeBtn { order: 7; }
.account-type-section > .social-consent { order: 8; }
.account-type-section > .social-auto-note { order: 9; }

.account-type-section .social-auto-note {
    display: none;
}

.account-type-section .social-consent {
    margin: 11px auto 0;
    max-width: 470px;
    font-size: 11px;
    line-height: 1.55;
    color: #8a98aa;
}

.account-type-grid {
    gap: 12px;
    margin: 2px 0 14px;
}

.account-type-card {
    min-height: 142px;
    padding: 16px 14px 15px;
    gap: 5px;
    border: 1.5px solid #dce3ec;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
}

.account-type-card:hover {
    border-color: #a8c3fb;
    background: #fbfdff;
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(37, 99, 235, .07);
}

.account-type-card.selected {
    border-color: #2f6df6;
    background: #f8fbff;
    box-shadow: 0 0 0 2px rgba(47, 109, 246, .10);
}

.account-type-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 3px;
    font-size: 22px;
    background: #eff5ff;
}

.account-type-title {
    font-size: 16px;
}

.account-type-subtitle {
    font-size: 12px;
    line-height: 1.35;
    max-width: 200px;
}

.account-type-security {
    margin: 0 0 12px;
    padding-top: 12px;
    font-size: 11px;
    color: #8794a6;
}

.desktop-auth-banner {
    padding: 10px 13px;
    margin-bottom: 14px;
    border-radius: 11px;
    font-size: 12px;
}

.close-btn {
    top: 16px;
    right: 20px;
    font-size: 34px;
    opacity: .92;
}

@media (max-width: 700px) {
    body {
        padding: 16px 12px;
    }

    .auth-card {
        max-width: 100%;
        padding: 26px 22px 24px;
        border-radius: 20px;
    }

    .brand h1 { font-size: 31px; }

    .account-type-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .account-type-card {
        min-height: 136px;
        padding: 14px 10px;
    }
}

@media (max-width: 480px) {
    body { padding: 12px 8px; }

    .auth-card {
        padding: 24px 16px 21px;
        border-radius: 18px;
    }

    .social-auth-stack {
        grid-template-columns: 1fr;
    }

    .account-type-grid {
        grid-template-columns: 1fr;
    }

    .account-type-card {
        min-height: 112px;
    }

    .account-type-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .account-type-security {
        font-size: 10.5px;
    }
}

/* Google sign-in button — compact, familiar OAuth treatment for both links and consent POST forms. */
.social-auth-btn[href*="/auth/google/start"],
form[action*="/auth/google/start"] .social-auth-btn {
    position: relative;
    width: 100%;
    max-width: 420px;
    min-height: 44px;
    height: 44px;
    margin-inline: auto;
    padding: 0 18px 0 48px;
    justify-content: center;
    border: 1px solid #747775;
    border-radius: 6px;
    background: #ffffff;
    color: #1f1f1f;
    font-family: Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .01px;
    box-shadow: none;
}

.social-auth-btn[href*="/auth/google/start"]:hover,
form[action*="/auth/google/start"] .social-auth-btn:hover {
    background: #f8fafd;
    border-color: #747775;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .20), 0 1px 3px rgba(60, 64, 67, .10);
    transform: none;
}

.social-auth-btn[href*="/auth/google/start"]:active,
form[action*="/auth/google/start"] .social-auth-btn:active {
    background: #f1f3f4;
    box-shadow: none;
    transform: none;
}

.social-auth-btn[href*="/auth/google/start"]:focus-visible,
form[action*="/auth/google/start"] .social-auth-btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.social-auth-btn[href*="/auth/google/start"] .google-mark,
form[action*="/auth/google/start"] .social-auth-btn .google-mark {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    overflow: hidden;
    text-indent: -9999px;
    color: transparent;
    background: center / 18px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill='%234285F4' d='M17.64 9.205c0-.638-.057-1.252-.164-1.841H9v3.482h4.844a4.14 4.14 0 0 1-1.797 2.715v2.258h2.909c1.703-1.568 2.684-3.878 2.684-6.614z'/%3E%3Cpath fill='%2334A853' d='M9 18c2.43 0 4.468-.806 5.956-2.181l-2.909-2.258c-.806.54-1.835.859-3.047.859-2.344 0-4.328-1.585-5.037-3.714H.956v2.332A9 9 0 0 0 9 18z'/%3E%3Cpath fill='%23FBBC05' d='M3.963 10.706A5.41 5.41 0 0 1 3.682 9c0-.592.102-1.167.281-1.706V4.962H.956A9 9 0 0 0 0 9c0 1.452.347 2.827.956 4.038l3.007-2.332z'/%3E%3Cpath fill='%23EA4335' d='M9 3.58c1.322 0 2.508.455 3.442 1.345l2.582-2.582C13.464.89 11.426 0 9 0A9 9 0 0 0 .956 4.962l3.007 2.332C4.672 5.165 6.656 3.58 9 3.58z'/%3E%3C/svg%3E");
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

@media (max-width: 480px) {
    .social-auth-btn[href*="/auth/google/start"],
    form[action*="/auth/google/start"] .social-auth-btn {
        max-width: none;
        min-height: 44px;
        height: 44px;
    }
}
