/* Login Page Styles */

.login-page {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Login Container - Full screen centered layout */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #121212;
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 16px;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Centered glass card */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 384px; /* max-w-sm equivalent */
    border-radius: 24px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.06), #121212);
    backdrop-filter: blur(8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo */
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.logo-emoji {
    font-size: 24px;
    line-height: 1;
}

/* Title */
.login-title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
    margin-top: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1rem;
}

/* Form Mode Tabs */
.form-mode-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 4px;
    gap: 4px;
}

.mode-tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.mode-tab.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.05);
}

.input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-input {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
    line-height: 1.25rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.login-input::placeholder {
    color: rgb(209, 213, 219);
}

.login-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.login-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.strength-feedback {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
}

/* Message Styling */
.error-message {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(248, 113, 113);
    text-align: left;
    padding: 0.5rem;
    border-radius: 6px;
    background-color: rgba(248, 113, 113, 0.1);
    border-left: 3px solid rgb(248, 113, 113);
}

.success-message {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(34, 197, 94);
    text-align: left;
    padding: 0.5rem;
    border-radius: 6px;
    background-color: rgba(34, 197, 94, 0.1);
    border-left: 3px solid rgb(34, 197, 94);
}

.login-divider {
    opacity: 0.1;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sign-in-button {
    width: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sign-in-button:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(139, 92, 246, 1) 100%);
}

.sign-in-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Google Sign In Button */
.google-sign-in-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.google-sign-in-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Forgot Password Link */
.forgot-password-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease-in-out;
    margin-bottom: 0.75rem;
}

.forgot-password-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.sign-up-text {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

.sign-up-link {
    font-size: 0.75rem;
    line-height: 1rem;
    color: rgb(156, 163, 175);
}

.sign-up-anchor {
    text-decoration: underline;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.15s ease-in-out;
}

.sign-up-anchor:hover {
    color: white;
}

/* User count and avatars */
.user-showcase {
    position: relative;
    z-index: 10;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.showcase-text {
    color: rgb(156, 163, 175);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.showcase-highlight {
    font-weight: 500;
    color: white;
}

.user-avatars {
    display: flex;
    gap: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #181824;
    object-fit: cover;
    margin-left: -4px;
}

.user-avatar:first-child {
    margin-left: 0;
}

/* Loading and Error States */
.login-loading {
    opacity: 0.7;
    pointer-events: none;
}

.login-success {
    color: rgb(34, 197, 94);
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        padding: 1rem 0.5rem;
    }
    
    .login-card {
        padding: 1.5rem;
        max-width: 320px;
    }
    
    .login-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .user-showcase {
        margin-top: 2rem;
    }
}

/* Integration with existing sparkles */
.login-page .sparkles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Loading spinner for Google sign-in */
.google-loading {
    position: relative;
}

.google-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 0.5rem;
}

.auth-tabs {
    display: flex;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-tab.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.auth-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form .form-group {
    width: 100%;
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
    color: white;
    font-weight: 500;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 1rem 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.divider span {
    padding: 0 1rem;
}

/* ── Touch targets & iOS safe-area for login page ── */
.auth-submit-btn,
.google-sign-in-button,
.sign-in-button {
    min-height: 3rem; /* 48px — exceeds WCAG 44px touch target */
}

.login-container {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    /* Clears iOS home-indicator bar */
}

/* Extra-small phones (≤ 360px) */
@media (max-width: 360px) {
    .login-card {
        padding: 1.25rem 1rem;
        max-width: 100%;
        border-radius: 16px;
    }

    .login-title {
        font-size: 1.1rem;
    }

    .auth-tab {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}