:root {
    --primary-bg: #0a192f;
    --secondary-bg: #112240;
    --accent-color: #00a3ff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --error-color: #ff4444;
    --success-color: #00c851;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Matrix Background */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 480px;
    perspective: 1000px;
}

.auth-box {
    background: rgba(17, 34, 64, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 163, 255, 0.2);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-out;
}

/* Header Styles */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Forms Container */
.forms-container {
    position: relative;
    min-height: 400px;
}

/* Form Styles */
.auth-form {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.auth-form.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.auth-form h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem;
    padding-right: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 163, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.input-wrapper label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: all 0.3s;
    pointer-events: none;
    font-size: 0.95rem;
}

.input-wrapper input:focus,
.input-wrapper input:not(:placeholder-shown) {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.input-wrapper input:focus + label,
.input-wrapper input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.8rem;
    padding: 0 0.5rem;
    background: var(--secondary-bg);
    color: var(--accent-color);
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.input-wrapper i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
}

.input-wrapper .toggle-password {
    right: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.input-wrapper .toggle-password:hover {
    opacity: 1;
}

.input-wrapper .fa-lock {
    right: 2.5rem;
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-container input {
    display: none;
}

.checkbox-container .checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-container input:checked + .checkmark {
    background: var(--accent-color);
}

.checkbox-container input:checked + .checkmark:after {
    content: '✓';
    color: white;
    font-size: 12px;
}

.checkbox-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.forgot-password:hover {
    opacity: 0.8;
}

/* Terms Checkbox */
.terms-group {
    margin: 1.5rem 0;
}

.terms-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.terms-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.terms-container input:checked + .checkmark {
    background: var(--accent-color);
}

.terms-container input:checked + .checkmark:after {
    content: '✓';
    color: white;
    font-size: 12px;
}

.terms-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.terms-text a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.terms-text a:hover {
    opacity: 0.8;
}

/* Submit Button */
.auth-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(45deg, #0066CC, var(--accent-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
}

.auth-btn i {
    transition: transform 0.3s;
}

.auth-btn:hover i {
    transform: translateX(4px);
}

/* Form Switch Link */
.switch-form {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.switch-form a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.switch-form a:hover {
    opacity: 0.8;
}

/* Footer */
.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* Response Messages */
.response-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.response-message.success {
    background: rgba(0, 200, 81, 0.1);
    border-left: 3px solid var(--success-color);
    color: var(--success-color);
}

.response-message.error {
    background: rgba(255, 68, 68, 0.1);
    border-left: 3px solid var(--error-color);
    color: var(--error-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-box {
        padding: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-form h2 {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Loading State */
.auth-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.auth-btn.loading i {
    animation: spin 1s linear infinite;
}

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