* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background elements */
body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
    opacity: 0.3;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    color: #1a202c;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-card > p {
    text-align: center;
    color: #718096;
    margin-bottom: 32px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1a202c;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafafa;
}

.form-group input::placeholder {
    color: #a0aec0;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-group label[for="remember"] {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.oauth-buttons {
    margin-top: 32px;
}

.divider {
    text-align: center;
    color: #a0aec0;
    margin: 24px 0;
    position: relative;
    font-size: 14px;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 40px);
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
}

.btn-oauth::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: width 0.3s;
}

.btn-oauth:hover::before {
    width: 100%;
}

.btn-oauth:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-oauth:active {
    transform: translateY(0);
}

.btn-oauth svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-google:hover {
    border-color: #4285F4;
}

.btn-microsoft:hover {
    border-color: #0078d4;
}

/* Guest actions: no-login options (Get me out + Guest alerts) */
.guest-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.guest-actions .guest-actions-title {
    margin: 0 0 1rem 0;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
}

.guest-actions-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guest-actions-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.guest-actions-buttons a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.guest-actions-buttons a:active {
    transform: translateY(0);
}

.btn-guest-get-out {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff !important;
}

.btn-guest-get-out:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-guest-alerts {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    color: #fff !important;
}

.btn-guest-alerts:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
}

.guest-actions-sub {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 13px;
    color: #718096;
}

.guest-actions-sub a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.guest-actions-sub a:hover {
    text-decoration: underline;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    color: #718096;
    font-size: 14px;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.error-message {
    margin-top: 20px;
    padding: 14px 16px;
    background: #fee;
    color: #c53030;
    border-radius: 12px;
    border: 1px solid #fc8181;
    font-size: 14px;
    line-height: 1.5;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.success-message {
    margin-top: 20px;
    padding: 14px 16px;
    background: #f0fff4;
    color: #22543d;
    border-radius: 12px;
    border: 1px solid #68d391;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 640px) {
    .auth-card {
        padding: 36px 28px;
        border-radius: 20px;
    }
    
    .auth-card h1 {
        font-size: 28px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="password"],
    .form-group input[type="number"] {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn-primary {
        padding: 14px;
    }
    
    .g-recaptcha {
        transform: scale(0.85);
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Password strength indicator (optional enhancement) */
.password-hint {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

/* Mobile view: fit auth card on small screens (login/register work on web and mobile) */
@media (max-width: 768px) {
    body { padding: 12px; }
    .auth-container { max-width: 100%; }
    .auth-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .auth-card h1 { font-size: 26px; }
    .form-group { margin-bottom: 16px; }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="password"],
    .form-group input[type="number"] {
        padding: 12px 14px;
        font-size: 16px; /* avoids iOS zoom on focus */
    }
    .btn-primary { padding: 14px; }
}
