@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --vip-bg: #050510;
    --vip-card-bg: rgba(20, 20, 35, 0.6);
    --vip-accent: #00f0ff;
    --vip-accent-2: #7000ff;
    --vip-text: #ffffff;
    --vip-text-muted: #8b9bb4;
    --vip-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--vip-bg);
    color: var(--vip-text);
    min-height: 100vh;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Effects */
.vip-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--vip-accent);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--vip-accent-2);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, 50px); }
    66% { transform: translate(-20px, 20px); }
}

/* Login Card */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    perspective: 1000px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--vip-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--vip-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    animation: cardEntrance 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    width: 100%;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--vip-accent);
    border-radius: 20px;
    color: var(--vip-accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.card-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, white, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-header p {
    color: var(--vip-text-muted);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--vip-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vip-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--vip-accent);
    box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vip-text-muted);
    pointer-events: none;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--vip-accent), var(--vip-accent-2));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(112, 0, 255, 0.4);
}

.submit-btn:active {
    transform: translateY(0) scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.glow-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.submit-btn:hover .glow-effect {
    left: 100%;
}

/* Footer links */
.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.back-link {
    color: var(--vip-text-muted);
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link:hover {
    color: white;
}

/* Trading Animation Elements */
.chart-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: -1;
    opacity: 0.3;
}

/* Attempts Indicator - Mobile friendly */
.attempts-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* Toast Container - Mobile responsive */
.toast-container {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    right: env(safe-area-inset-right, 20px);
    left: env(safe-area-inset-left, 20px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
}

.toast {
    padding: 14px 18px;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
}

.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
}

.toast.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
}

.toast-icon {
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 4px;
}

.toast-close:hover {
    opacity: 1;
}

/* Lockout Overlay - Mobile */
.lockout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lockout-card {
    background: var(--vip-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--vip-border);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.lockout-icon {
    color: var(--vip-accent);
    margin-bottom: 1rem;
}

.lockout-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.lockout-card p {
    color: var(--vip-text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.lockout-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--vip-accent);
    font-family: var(--font-heading);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ============================================ */

/* Small phones */
@media (max-width: 380px) {
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 25px 20px;
        border-radius: 20px;
    }
    
    .card-header h1 {
        font-size: 1.75rem;
    }
    
    .card-header p {
        font-size: 0.85rem;
    }
    
    .brand-badge {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .submit-btn {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .toast {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .orb-1 {
        width: 250px;
        height: 250px;
    }
    
    .orb-2 {
        width: 300px;
        height: 300px;
    }
}

/* Standard mobile */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 25px;
    }
    
    .card-header h1 {
        font-size: 1.9rem;
    }
    
    .card-header {
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-footer {
        margin-top: 1.25rem;
    }
    
    /* Larger touch targets */
    .form-input {
        height: 48px;
    }
    
    .submit-btn {
        height: 52px;
    }
    
    /* Toast adjustments */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        max-width: 100%;
    }
}

/* Large phones / Small tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .login-card {
        padding: 35px;
    }
    
    .card-header h1 {
        font-size: 2.2rem;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-card {
        max-width: 480px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 20px 0;
    }
    
    .login-container {
        min-height: auto;
        padding: 10px;
    }
    
    .login-card {
        padding: 20px;
    }
    
    .card-header {
        margin-bottom: 1rem;
    }
    
    .card-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .card-header p {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    
    .brand-badge {
        padding: 4px 10px;
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-input {
        padding: 10px 12px;
    }
    
    .submit-btn {
        padding: 10px;
        margin-top: 0.5rem;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .toast-container {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }
    
    .login-container {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Dark mode support for browsers */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .orb {
        animation: none;
    }
    
    .login-card {
        animation: none;
    }
    
    .glow-effect {
        display: none;
    }
    
    .toast {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-card {
        border-width: 2px;
    }
    
    .form-input {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    .vip-background,
    .orb,
    .grid-overlay {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
