/* 🌌 Futuristic Background */
body {
    margin: 0;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #ffa5a5 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🌟 Main Form Card */
main {
    width: 420px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

/* Title */
h1 {
    margin-bottom: 25px;
    font-size: 36px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form label {
    text-align: left;
    font-size: 14px;
    color: white;
    font-weight: 600;
}

/* Inputs */
.auth-form input {
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    transition: all 0.3s ease;
    font-size: 15px;
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.auth-form input:focus {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* Avatar */
.avatar-preview {
    margin: 15px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.avatar-preview:hover {
    transform: scale(1.05);
    border-color: white;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* CAPTCHA */
.captcha-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

canvas {
    width: 120px;
    height: 40px;
    border-radius: 8px;
    display: block;
    border: none;
    background: rgba(255, 255, 255, 0.2);
}

/* Refresh Button */
#refreshCaptcha {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

#refreshCaptcha:hover {
    transform: rotate(360deg) scale(1.2);
}

#captchaInput {
    text-align: center;
    font-weight: bold;
    letter-spacing: 3px;
}

/* Verify Button */
.verify-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-top: 20px;
    opacity: 0.5;
    pointer-events: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.verify-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.verify-btn.enabled {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.verify-btn.enabled:hover {
    transform: translateY(-4px);
}

.verify-btn.enabled:hover::before {
    width: 300px;
    height: 300px;
}

.verify-btn span {
    position: relative;
    z-index: 1;
}

/* 🔔 Alert System */
.alert {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(20px);
    padding: 20px 35px;
    border-radius: 18px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    z-index: 99999;
    max-width: 450px;
    width: min(92vw, 450px);
    line-height: 1.6em;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.65);
}

#alertMessage {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.1px;
    text-shadow: none;
}

.alert.show {
    top: 30px;
    opacity: 1;
    pointer-events: auto;
    animation: slideInDown 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alert.success {
    border-left: 8px solid #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.18), rgba(255, 255, 255, 0.99));
    color: #065f46;
    box-shadow: 0 15px 60px rgba(0, 255, 136, 0.3), 0 0 0 3px rgba(0, 255, 136, 0.3);
}

.alert.error {
    border-left: 8px solid #ff4444;
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.2), rgba(255, 255, 255, 0.99));
    color: #991b1b;
    box-shadow: 0 15px 60px rgba(255, 68, 68, 0.3), 0 0 0 3px rgba(255, 68, 68, 0.3);
}

.alert.success #alertMessage {
    color: #065f46;
}

.alert.error #alertMessage {
    color: #991b1b;
}

@keyframes slideInDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🔹 Login Link at Bottom */
p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-top: 20px;
}

.login-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.login-link:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}