/* ============================================
   CLEARDEAL - PREMIUM AUTH DESIGN SYSTEM
   Zero Cost | Pure CSS | Mobile First
   ============================================ */

/* === ROOT VARIABLES (PREMIUM PALETTE) === */
:root {
    /* Gradients Premium */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-dark: linear-gradient(135deg, #232526 0%, #414345 100%);

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: rgba(31, 38, 135, 0.37);

    /* Shadows Premium */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 15px 50px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 25px 70px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.4);

    /* Typography */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Timing */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === CONTAINER BACKGROUND === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;

    /* Animated gradient background */
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Animated particles (optional subtle effect) */
.auth-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: float 20s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}

/* === GLASSMORPHISM CARD === */
.auth-card {
    position: relative;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);

    /* Subtle glow */
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 1px 3px rgba(255, 255, 255, 0.3) inset;

    animation: cardSlideIn 0.6s var(--transition-smooth);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === LOGO === */
.auth-logo {
    display: block;
    margin: 0 auto 2rem;
    max-width: 180px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s var(--transition-smooth);
}

.auth-logo:hover {
    transform: scale(1.05);
}

/* === TITLE === */
.auth-title {
    text-align: center;
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* === FORM === */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* === INPUTS === */
.auth-input {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: #333;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.auth-input::placeholder {
    color: rgba(100, 100, 100, 0.6);
}

.auth-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow:
        0 0 0 4px rgba(102, 126, 234, 0.15),
        var(--shadow-md);
    transform: translateY(-2px);
}

.auth-input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
}

/* === BUTTONS === */
.auth-button {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Primary Button (Gradient) */
.auth-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow:
        0 8px 20px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

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

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

.auth-button-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 30px rgba(102, 126, 234, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.auth-button-primary:active {
    transform: translateY(0);
    box-shadow:
        0 4px 15px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Google Button (Glass effect) */
.auth-button-google {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.auth-button-google:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.auth-button-google:active {
    transform: translateY(0);
}

/* === DIVIDER === */
.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.auth-divider span {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0 1rem;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === LINKS === */
.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.auth-link a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s var(--transition-smooth);
}

.auth-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s var(--transition-smooth);
}

.auth-link a:hover {
    color: #fff;
}

.auth-link a:hover::after {
    width: 100%;
}

/* === ERROR/SUCCESS MESSAGES === */
.auth-error,
.auth-success {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    animation: messageSlideIn 0.4s var(--transition-smooth);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fee;
}

.auth-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #efe;
}

.auth-error.show,
.auth-success.show {
    display: block;
}

/* === LOADING STATE === */
.loading {
    pointer-events: none;
}

.loading .auth-button {
    opacity: 0.7;
    cursor: wait;
}

.loading .auth-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* === TERMS DISCLAIMER === */
.auth-card p[style*="font-size: 0.85rem"] {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.75) !important;
    text-align: center;
    margin-top: 1.5rem;
    line-height: 1.6;
}

.auth-card p a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s var(--transition-smooth);
}

.auth-card p a:hover {
    color: white;
    border-bottom-color: white;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .auth-input,
    .auth-button {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast for better readability */
@media (prefers-contrast: high) {
    .auth-card {
        background: rgba(255, 255, 255, 0.25);
        border: 2px solid rgba(255, 255, 255, 0.5);
    }

    .auth-input {
        background: rgba(255, 255, 255, 0.95);
        border-width: 2px;
    }
}

/* === FOCUS VISIBLE (Keyboard Navigation) === */
.auth-button:focus-visible,
.auth-input:focus-visible,
.auth-link a:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}