/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 10, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333333;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Main Container */
.signup-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Signup Card */
.signup-card {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    border: 1px solid #333333;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.signup-card:hover {
    border-color: #444444;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.logo {
    height: 48px;
    width: auto;
}

/* Signup Form */
.signup-form {
    width: 100%;
}

.signup-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 32px;
    color: #ffffff;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #a0a0a0;
    z-index: 1;
    pointer-events: none;
}

.input-field {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background-color: #2a2a2a;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
}

.input-field::placeholder {
    color: #666666;
}

.input-field:focus {
    outline: none;
    border-color: #8b5cf6;
    background-color: #333333;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-field:focus + .input-icon {
    color: #8b5cf6;
}

/* Input validation states */
.input-field:valid {
    border-color: #10b981;
}

.input-field:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

/* Error Messages */
.error-message {
    font-size: 14px;
    color: #ef4444;
    min-height: 20px;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Success Messages */
.success-message {
    font-size: 14px;
    color: #10b981;
    min-height: 20px;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.success-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    width: 100%;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    margin-bottom: 16px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-discord {
    background: linear-gradient(135deg, #4752C4 0%, #3c47a3 100%);
    color: white;
    margin-bottom: 20px;
}

.btn-discord:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(71, 82, 196, 0.3);
}

.btn-discord:active {
    transform: translateY(0);
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Button Spinners */
.btn-spinner {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: #333333;
}

.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333333;
}

.divider-text {
    padding: 0 16px;
    font-size: 14px;
    color: #666666;
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 8px;
}

.login-link p {
    font-size: 14px;
    color: #a0a0a0;
}

.link {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Terms Container */
.terms-container {
    text-align: center;
}

.terms-text {
    font-size: 14px;
    color: #a0a0a0;
    line-height: 1.5;
}

.terms-link {
    color: #8b5cf6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
}

.strength-weak {
    color: #ef4444;
}

.strength-medium {
    color: #f59e0b;
}

.strength-strong {
    color: #10b981;
}

/* Form Progress Indicator */
.form-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.progress-step {
    flex: 1;
    height: 3px;
    background: #333333;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.progress-step.active {
    background: #8b5cf6;
}

.progress-step.completed {
    background: #10b981;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .signup-card {
        padding: 32px 24px;
    }
    
    .signup-title {
        font-size: 22px;
    }
    
    .input-field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .form {
        gap: 16px;
    }
}

@media (max-width: 360px) {
    .signup-card {
        padding: 24px 20px;
    }
    
    .signup-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .input-field {
        padding: 14px 14px 14px 44px;
    }
}

/* Focus Styles for Accessibility */
.btn:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.input-field:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.link:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .signup-card {
        border-color: #666666;
    }
    
    .input-field {
        border-color: #666666;
    }
    
    .error-message {
        color: #ff6b6b;
    }
    
    .success-message {
        color: #51cf66;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
        border: 3px solid #8b5cf6;
    }
}

/* Dark Mode (already default, but explicit) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0a0a0a;
        color: #ffffff;
    }
}

/* Print Styles */
@media print {
    .signup-card {
        box-shadow: none;
        border: 1px solid #333333;
    }
    
    .btn {
        background: #8b5cf6 !important;
        color: white !important;
    }
}
