/* Authentication Pages Styling */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --dark-bg: #1a1f2e;
    --dark-surface: #2a3142;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: rgba(148, 163, 184, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --success: #10b981;
    --danger: #ef4444;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--dark-bg);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
    color: var(--text-primary);
    background-image: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1), transparent 50%),
                      radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.1), transparent 50%);
    overflow-x: hidden;
}

/* Top Navigation Bar */
.navbar {
    background: rgba(26, 31, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.logo-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.language-switcher {
    display: flex;
    align-items: center;
}

.language-select {
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.language-select:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.language-select option {
    background: var(--dark-surface);
    color: var(--text-primary);
    padding: 0.5rem;
}

.nav-cart {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.nav-cart:hover {
    color: var(--primary-color);
}

.nav-account, .nav-logout, .nav-login, .nav-register {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-account:hover, .nav-logout:hover, .nav-login:hover {
    color: var(--text-primary);
}

.nav-login.active {
    color: var(--primary-color);
}

.nav-register {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-register:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-register.active {
    background: var(--secondary-color);
}

.cart-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 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(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: rgba(42, 49, 66, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

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

.auth-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 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(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: rgba(26, 31, 46, 0.5);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: rgba(26, 31, 46, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    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: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.4);
}

.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); }
}

/* Footer */
.footer {
    background: var(--dark-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
    padding: 3rem 0 0 0;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

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

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.footer-bottom p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dark-bg);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-cart, .nav-account, .nav-logout {
        display: none;
    }

    .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;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }
}

@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(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    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: color 0.2s ease;
}

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