/* Authentication Pages Styling */
/* Base styles (html, body) are in base.css */
/* Navigation styles are in navigation.css */
/* Footer styles are in footer.css */

/* Auth-specific CSS variables (extends base.css variables) */
:root {
    --auth-card-bg: rgba(26, 26, 26, 0.95);
    --auth-border: rgba(255, 215, 0, 0.2);
    --auth-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    --auth-input-bg: rgba(42, 49, 66, 0.5);
    --auth-input-focus: rgba(42, 49, 66, 0.8);
}

/* Main Content */
.main-content {
    margin-top: 100px;
    min-height: calc(100vh - 100px);
    padding: 2rem 0 0 0;
}

.auth-container {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    box-sizing: border-box;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 149, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.auth-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--auth-shadow);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    border: 2px solid var(--auth-border);
    transition: all 0.3s ease;
}

.auth-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
    transition: transform 0.3s ease;
}

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

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.8;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
    min-height: 68px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.form-group input {
    padding: 12px 14px 12px 45px;
    border: 2px solid var(--auth-border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--auth-input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: var(--auth-input-focus);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
    transform: translateY(-1px);
}

.form-icon {
    position: absolute;
    top: 32px;
    left: 14px;
    font-size: 1.1rem;
    opacity: 0.6;
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    top: 32px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.password-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
}

.toggle-icon {
    font-size: 1.1rem;
    opacity: 0.6;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.forgot-password, .terms-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover, .terms-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.auth-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #1a0f00;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
}

.auth-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 215, 0, 0.5);
}

.auth-btn.primary:active {
    transform: translateY(0);
}

.auth-btn.secondary {
    background: #d37b1e;
    color: #ffffff;
    border: 2px solid #d37b1e;
    box-shadow: 0 4px 12px rgba(211, 123, 30, 0.2);
}

.auth-btn.secondary:hover {
    background: #b86719;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(211, 123, 30, 0.3);
}

.btn-icon {
    font-size: 1.1rem;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 10px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: rgba(42, 49, 66, 0.95);
    padding: 0 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
}

.social-login {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: rgba(26, 31, 46, 0.5);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.social-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn.google:hover {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.social-btn.discord:hover {
    background: #5865f2;
    color: white;
    border-color: #5865f2;
}

.social-icon {
    font-size: 1.1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.7;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.error-message, .success-message {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.error-icon, .success-icon {
    font-size: 1.1rem;
}

/* Field validation errors - hidden text, visual only */
.field-error {
    display: none;
}

.field-error.show {
    display: none;
}

/* Label wrapper for inline warnings */
.label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

/* Inline field warning messages */
.field-warning {
    font-size: 0.7rem;
    color: #e53e3e;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: auto;
    padding-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.field-warning.active {
    opacity: 1;
}

/* Password requirements checklist */
.password-requirements {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    padding: 8px 10px;
    background: rgba(42, 49, 66, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.password-requirements.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Add space for password requirements */
.form-group:has(.password-requirements.show) {
    margin-bottom: 85px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    line-height: 1.2;
}

.requirement-icon {
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.requirement.met {
    color: var(--success);
}

.requirement.met .requirement-icon {
    color: var(--success);
}

.requirement.unmet {
    color: var(--danger);
}

/* Input error state - more prominent visual feedback */
.form-group input.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design - Auth Pages Only */
@media (max-width: 768px) {
    .main-content {
        margin-top: 70px;
    }

    .auth-container {
        padding: 10px;
    }

    .auth-card {
        padding: 25px 18px;
        margin: 0;
        border-radius: 16px;
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .social-login {
        flex-direction: column;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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

@media (max-width: 480px) {
    .auth-card {
        padding: 20px 15px;
        max-width: 100%;
    }

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

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Fix for very small screens or when form is too narrow */
@media (max-width: 420px) {
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .auth-card {
        max-width: calc(100vw - 20px);
    }
}

/* Terms & Conditions error message styling */
.terms-error-message {
    position: absolute;
    bottom: -35px;
    left: 0;
    right: 0;
    display: none;
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(10px);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
    z-index: 100;
}

.terms-error-message.show {
    display: flex;
    animation: fadeInShake 0.25s ease-out;
}

/* Reserve space for terms error */
.form-options {
    position: relative;
    margin-bottom: 10px;
}

.terms-error-message .error-icon {
    font-size: 1rem;
}

.checkbox-container.checkbox-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    animation: shake 0.25s ease-in-out;
}

.checkbox-container.checkbox-error .checkmark {
    border-color: var(--danger);
}

@keyframes fadeInShake {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0) translateX(-3px);
    }
    75% {
        transform: translateY(0) translateX(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

/* Animation for form loading */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: slideUp 0.6s ease-out;
}

/* Focus states for accessibility */
.auth-btn:focus,
.social-btn:focus,
.form-group input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading state for buttons */
.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.auth-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* OTP Verification Styles */
.otp-info {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.otp-info p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.otp-input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.5em;
    padding: 16px 20px !important;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.resend-btn:hover:not(:disabled) {
    color: var(--secondary-color);
}

.resend-btn:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
    text-decoration: none;
}
