:root {
    --primary-purple: #8b5cf6;
    --secondary-purple: #7c3aed;
    --dark-purple: #5b21b6;
    --light-purple: #a78bfa;
    --soft-purple: #c4b5fd;
    --glow-purple: #8b5cf6;
    --bg-light: #faf9fc;
    --bg-card: #ffffff;
    --bg-overlay: rgba(139, 92, 246, 0.05);
    --text-dark: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-light: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --dental-blue: #60a5fa;
    --dental-mint: #34d399;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f3f0ff 50%, #ede9fe 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="50" cy="50" r="2" fill="%23c4b5fd" opacity="0.3"/><circle cx="150" cy="50" r="1.5" fill="%23a78bfa" opacity="0.4"/><circle cx="100" cy="150" r="2.5" fill="%238b5cf6" opacity="0.2"/></svg>') repeat;
    background-size: 200px 200px;
    z-index: -1;
    animation: float-pattern 25s linear infinite;
}

@keyframes float-pattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-200px, -200px); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 25px;
    padding: 50px 40px;
    box-shadow: 
        0 25px 60px rgba(139, 92, 246, 0.12),
        0 10px 25px rgba(139, 92, 246, 0.08),
        0 0 0 1px rgba(139, 92, 246, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, var(--bg-overlay) 50%, transparent 70%);
    pointer-events: none;
}

.login-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-purple), var(--soft-purple), var(--primary-purple));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.1;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.dental-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tooth-icon {
    font-size: 48px;
    z-index: 2;
    position: relative;
    animation: tooth-sparkle 3s ease-in-out infinite;
}

@keyframes tooth-sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.05) rotate(5deg); }
    75% { transform: scale(1.08) rotate(-3deg); }
}

.smile-arc {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 3px solid var(--primary-purple);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    box-shadow: 
        0 0 25px rgba(139, 92, 246, 0.3),
        inset 0 0 25px rgba(139, 92, 246, 0.1);
    animation: smile-pulse 4s ease-in-out infinite;
}

@keyframes smile-pulse {
    0%, 100% { 
        box-shadow: 
            0 0 25px rgba(139, 92, 246, 0.3),
            inset 0 0 25px rgba(139, 92, 246, 0.1);
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(139, 92, 246, 0.5),
            inset 0 0 35px rgba(139, 92, 246, 0.2);
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.logo-container h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-container p {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.auth-form {
    transition: all 0.4s ease;
    transform: translateY(0);
    opacity: 1;
}

.auth-form.hidden {
    display: none;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 18px 24px;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 15px;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.glow-button {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 
        0 8px 25px rgba(139, 92, 246, 0.3),
        0 4px 15px rgba(139, 92, 246, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.glow-button:hover,
.glow-button:focus {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(139, 92, 246, 0.4),
        0 8px 25px rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, var(--secondary-purple), var(--primary-purple));
}

.glow-button:active {
    transform: translateY(-1px);
}

.glow-button::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.6s;
}

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

.link-button {
    background: none;
    border: none;
    color: var(--primary-purple);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.link-button:hover {
    color: var(--secondary-purple);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

.code-timer {
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 15px;
    background: var(--bg-light);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.status-message {
    margin-top: 25px;
    padding: 16px 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease;
}

.status-message.show {
    opacity: 1;
    transform: translateY(0);
}

.status-message.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.status-message.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
    border: 2px solid var(--error-color);
    color: var(--error-color);
}

.status-message.info {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(167, 139, 250, 0.1));
    border: 2px solid var(--primary-purple);
    color: var(--primary-purple);
}

/* Floating dental elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.float-tooth {
    position: absolute;
    font-size: 24px;
    opacity: 0.6;
    animation: float 15s ease-in-out infinite;
}

.float-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.float-2 {
    top: 30%;
    right: 15%;
    animation-delay: -3s;
    animation-duration: 22s;
}

.float-3 {
    bottom: 25%;
    left: 15%;
    animation-delay: -6s;
    animation-duration: 20s;
}

.float-4 {
    top: 15%;
    right: 30%;
    animation-delay: -9s;
    animation-duration: 25s;
}

.float-5 {
    bottom: 15%;
    right: 10%;
    animation-delay: -12s;
    animation-duration: 19s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-30px) rotate(5deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-15px) rotate(-3deg);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-25px) rotate(7deg);
        opacity: 0.7;
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 40px 25px;
        border-radius: 20px;
    }
    
    .dental-logo {
        width: 80px;
        height: 80px;
    }
    
    .tooth-icon {
        font-size: 36px;
    }
    
    .smile-arc {
        width: 60px;
        height: 60px;
    }
    
    .logo-container h1 {
        font-size: 26px;
    }
    
    .logo-container p {
        font-size: 14px;
    }
    
    .floating-elements {
        display: none;
    }
}

/* Touch devices - enhance interactions */
@media (hover: none) and (pointer: coarse) {
    .glow-button:active {
        transform: scale(0.95);
        box-shadow: 
            0 15px 40px rgba(139, 92, 246, 0.5),
            0 10px 30px rgba(139, 92, 246, 0.4);
    }
    
    .input-group input:focus {
        transform: translateY(-1px);
    }
    
    .link-button:active {
        transform: scale(0.95);
        background: rgba(139, 92, 246, 0.2);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .tooth-icon,
    .smile-arc,
    .float-tooth,
    body::before {
        animation: none;
    }
    
    .glow-button::before {
        display: none;
    }
}