/* ============================================
   ZoneOp Landing Page - Styles
   Theme: Dark with Orange accent (like ZoneOpApp)
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --bg-input: #242424;
    --accent-primary: #f97316;
    --accent-secondary: #ea580c;
    --accent-hover: #fb923c;
    --accent-gold: #fbbf24;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #333333;
    --border-focus: #f97316;
    --success: #22c55e;
    --error: #ef4444;
    --shadow-color: rgba(249, 115, 22, 0.15);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(234, 88, 12, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(251, 191, 36, 0.03) 0%, transparent 70%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50px);
    }
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 50;
}

[dir="rtl"] .language-selector {
    right: auto;
    left: 24px;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-btn:hover {
    background: var(--bg-input);
    border-color: var(--accent-primary);
}

.lang-flag {
    font-size: 1.25rem;
}

.chevron {
    transition: transform 0.2s ease;
}

.language-dropdown.show+.language-btn .chevron,
.language-btn:focus+.language-dropdown.show~.chevron {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

[dir="rtl"] .lang-option {
    text-align: right;
}

.lang-option:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.lang-option:first-child {
    border-radius: 12px 12px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 12px 12px;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(249, 115, 22, 0.3));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 20px rgba(249, 115, 22, 0.3));
    }

    50% {
        transform: scale(1.02);
        filter: drop-shadow(0 4px 30px rgba(249, 115, 22, 0.5));
    }
}

/* Slogan Section */
.slogan-section {
    text-align: center;
    margin-bottom: 32px;
}

.slogan-main {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.slogan-sub {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Form Card */
.form-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Error & Success Messages */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    text-align: center;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-left: 4px;
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* Captcha Section */
.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.captcha-input {
    flex: 1;
}

.captcha-image-wrapper {
    position: relative;
    width: 120px;
    height: 48px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.captcha-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.captcha-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-loading.hidden {
    display: none;
}

.refresh-captcha {
    width: 48px;
    height: 48px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.refresh-captcha:hover {
    background: var(--accent-hover);
    transform: rotate(180deg);
}

.refresh-captcha:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Referral Section */
.referral-section .input-wrapper {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.referral-hint {
    color: var(--success);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinners */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--accent-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-link a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Footer */
.footer {
    margin-top: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer p {
    margin-bottom: 4px;
}

.footer-note {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 24px 16px;
    }

    .language-selector {
        top: 16px;
        right: 16px;
    }

    [dir="rtl"] .language-selector {
        left: 16px;
    }

    .logo {
        width: 100px;
    }

    .slogan-main {
        font-size: 1.5rem;
    }

    .form-card {
        padding: 24px 16px;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .captcha-wrapper {
        flex-wrap: nowrap;
    }

    .captcha-image-wrapper {
        width: 100px;
    }

    .refresh-captcha {
        width: 44px;
        height: 48px;
    }
}

/* Focus States for Accessibility */
input:focus,
button:focus {
    outline: none;
}

button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}