/* ==========================================================================
   Auth Components - Social login, status messages, verification, city,
                     loading overlay, alerts
   ========================================================================== */


/* --- Social Login Buttons --- */
.social-login-section {
    margin-bottom: 8px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.social-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn:hover::after {
    opacity: 0.04;
}

.social-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.social-btn-strava {
    border-color: #FC4C02;
    color: #FC4C02;
}

.social-btn-strava:hover {
    background: #FFF5F0;
    border-color: #FC4C02;
}

.social-btn-google {
    color: #000;
}

.social-btn-google:hover {
    background: #F8F9FA;
    border-color: #dadce0;
}

.social-btn-icon {
    flex-shrink: 0;
}

.social-divider {
    display: flex;
    align-items: center;
    margin: 16px 0 12px;
    gap: 12px;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e1e1;
}

.social-divider span {
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
    font-weight: 300;
}


/* --- Email / Username / Full Name Status Messages --- */
.email-status,
.username-status,
.full-name-status {
    font-size: 12px;
    margin-top: 8px;
    padding: 6px 10px;
    padding-left: 14px;
    border-radius: 4px;
    font-weight: 500;
    display: none;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-out;
}

.email-status.show,
.username-status.show,
.full-name-status.show {
    display: block;
}

.email-status.available,
.email-status.success,
.username-status.available,
.full-name-status.valid {
    color: #065f46;
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
}

.email-status.taken,
.email-status.error,
.username-status.taken,
.full-name-status.invalid {
    color: #991b1b;
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
}

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

/* --- Field Status (generic) --- */
.field-status {
    font-size: 12px;
    margin-top: 4px;
    display: none;
    transition: all 0.3s ease;
}

.field-status.success {
    color: #10b981;
    display: block;
}

.field-status.error {
    color: #dc3545;
    display: block;
}

.field-status.checking {
    color: #6b7280;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
}


/* --- City Autocomplete --- */
.city-select {
    position: relative;
}

.city-input {
    width: 100%;
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e1e1e1;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.city-suggestions.show {
    display: block;
}

.city-suggestion {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
    font-size: 16px;
    color: #374151;
}

.city-suggestion:last-child {
    border-bottom: none;
}

.city-suggestion:hover,
.city-suggestion.highlighted {
    background-color: #f3f4f6;
}

.city-suggestion.selected {
    background-color: #667eea;
    color: white;
}

.city-suggestion .city-name {
    font-weight: 500;
}

.city-suggestion .city-country {
    color: #6b7280;
    font-size: 14px;
}

.city-suggestion.selected .city-country {
    color: rgba(255, 255, 255, 0.8);
}


/* --- Email Verification --- */
.verification-content {
    text-align: center;
    padding: 20px 0;
}

.verification-icon {
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    font-size: 48px;
    animation: scaleIn 0.5s ease-out;
}

.verification-message h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.verification-message p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.verification-email {
    font-size: 18px;
    font-weight: 600;
    color: #10b981;
    background: #f0fdf4;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 16px 0;
    border: 2px solid #bbf7d0;
}

.verification-actions {
    margin-top: 30px;
}

.verification-actions .form-btn {
    margin-bottom: 16px;
}

/* Verification prompt / success / waiting screens */
.verification-prompt,
.verification-success,
.verification-waiting {
    text-align: center;
    padding: 20px 0;
}

.verification-prompt h3,
.verification-success h3,
.verification-waiting h3 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.verification-message {
    color: #4b5563;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.verification-email {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.verification-email strong {
    color: #1f2937;
    font-weight: 600;
}

.email-warning {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    font-size: 14px;
    color: #92400e;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.verification-instructions {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.verification-instructions h4 {
    color: #166534;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.verification-instructions ol {
    color: #15803d;
    font-size: 14px;
    margin-left: 20px;
}

.verification-instructions li {
    margin-bottom: 5px;
}

/* Verification steps */
.verification-steps {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.verification-steps h4 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: left;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 8px 0;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-text {
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}

.verification-footer {
    margin-top: 25px;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.help-text {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Resend button & messages */
.resend-btn {
    background: #059669 !important;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.resend-btn:hover {
    background: #047857 !important;
}

.resend-btn:disabled {
    background: #d1d5db !important;
}

.resend-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    animation: fadeInUp 0.4s ease-out;
}

.resend-message.success-message {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.resend-message.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}


/* --- Messages & Alerts --- */
.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 400;
    animation: alertSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Soft, neutral-informational variant used e.g. when the user's email is
   registered via a social provider and we're nudging them to the right
   button instead of showing a password prompt. */
.alert-info {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}


/* --- Loader (inline spinner) --- */
.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}


/* --- Loading Overlay --- */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    border-radius: 16px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}


/* ==========================================================================
   Auth Components Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .verification-steps {
        padding: 15px;
        margin: 15px 0;
    }

    .step {
        padding: 6px 0;
    }

    .step-text {
        font-size: 13px;
    }
}


/* ==========================================================================
   Onboarding password nudge — shown right after social signup completes.
   ========================================================================== */

.onboard-pw-intro {
    margin-bottom: 18px;
}

.onboard-pw-title {
    margin: 0 0 8px;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 1.18rem;
    color: #0a0a0a;
    letter-spacing: 0.2px;
}

.onboard-pw-subtitle {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #5b6470;
}

.onboard-pw-status {
    min-height: 18px;
    margin-top: 6px;
    font-size: 12.5px;
    color: #b91c1c;
}

.onboard-pw-status.ok {
    color: #15803d;
}

.onboard-pw-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

/* Borderless ghost button — equal visual weight to primary because Skip is
   not a "secondary cancel" here, it's a legitimate path the user can pick. */
.btn-ghost {
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, transform 0.18s ease;
}

.btn-ghost:hover {
    background: #f3f4f6;
    color: #111;
    box-shadow: 0 6px 14px rgba(10,10,10,0.08);
    transform: translateY(-1px);
}

.btn-ghost:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(10,10,10,0.10);
}

.onboard-pw-primary {
    box-shadow: 0 8px 22px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.10);
}


/* Live password-requirements checklist for the onboarding nudge. */
.onboard-pw-reqs {
    list-style: none;
    padding: 0;
    margin: 10px 0 6px;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.7;
}

.onboard-pw-reqs li {
    position: relative;
    padding-left: 20px;
    transition: color 0.2s ease;
}

.onboard-pw-reqs li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.onboard-pw-reqs li.met {
    color: #15803d;
}

.onboard-pw-reqs li.met::before {
    background: #15803d;
    border-color: #15803d;
}

.onboard-pw-reqs li.met::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    width: 3px;
    height: 6px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-65%) rotate(45deg);
}
