/* ============================================
   InvestmentPro - Authentication Styles
   Modern Fintech Mobile-First Design
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #050B18;
    --bg-secondary: #0A1128;
    --bg-card: rgba(10, 17, 40, 0.8);
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --neon-green: #00FF88;
    --neon-green-dark: #00CC6A;
    --neon-blue: #00D4FF;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-focus-bg: rgba(255, 255, 255, 0.08);
    --danger: #FF4757;
    --success: #2ED573;
    --warning: #FFA502;
    --gradient-1: linear-gradient(135deg, #00FF88 0%, #00CC6A 100%);
    --gradient-2: linear-gradient(135deg, #00D4FF 0%, #0099CC 100%);
    --shadow-neon: 0 0 30px rgba(0, 255, 136, 0.3);
    --shadow-card: 0 25px 45px rgba(0, 0, 0, 0.4);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Grid Animation */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Background Glow Effects */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    z-index: 0;
    animation: glowPulse 4s ease-in-out infinite;
}

.bg-glow-1 {
    width: 400px;
    height: 400px;
    background: var(--neon-green);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.bg-glow-2 {
    width: 350px;
    height: 350px;
    background: var(--neon-blue);
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.1); }
}

/* Auth Wrapper - Centers the card */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Auth Container - Glassmorphism Card */
.auth-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-1);
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--bg-primary);
    box-shadow: var(--shadow-neon);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Tab Switcher */
.tab-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 30px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--gradient-1);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.tab-btn:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 2;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-input:focus {
    background: var(--input-focus-bg);
    border-color: var(--neon-green);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-input:focus + .input-border {
    width: 100%;
}

.form-input:focus ~ .input-icon {
    color: var(--neon-green);
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: var(--transition);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--neon-green);
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: var(--transition);
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--gradient-1);
    border-color: var(--neon-green);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    color: var(--text-secondary);
    font-size: 13px;
}

.forgot-link {
    color: var(--neon-green);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--neon-blue);
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient-1);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:active::after {
    width: 300px;
    height: 300px;
}

/* OTP Section */
.otp-wrapper {
    display: flex;
    gap: 10px;
}

.otp-input-wrapper {
    flex: 1;
}

.otp-btn {
    padding: 14px 20px;
    background: var(--gradient-2);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.otp-btn:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.otp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.otp-timer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.otp-timer i {
    color: var(--neon-green);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Divider */
.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--bg-secondary);
    padding: 0 15px;
    color: var(--text-secondary);
    font-size: 12px;
    position: relative;
    text-transform: uppercase;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn:hover {
    background: var(--input-focus-bg);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 25px;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.auth-footer a {
    color: var(--neon-green);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--neon-blue);
    text-decoration: underline;
}

/* Alert Messages */
.alert-custom {
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--neon-blue);
}

/* Loading Spinner */
.btn-loader {
    display: inline-block;
}

/* Desktop: Keep mobile container */
@media (min-width: 768px) {
    .auth-wrapper {
        max-width: 420px;
    }
    
    body {
        align-items: center;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .auth-container {
        padding: 30px 20px;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .form-input {
        padding: 12px 15px 12px 40px;
        font-size: 14px;
    }
    
    .otp-wrapper {
        flex-direction: column;
    }
    
    .otp-btn {
        width: 100%;
    }
}

/* Input Autofill Style Override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-secondary) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Remove number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}