/* ==========================================================================
   Mr.GoViral Investment Login Page - Mobile App Design with Original Theme
   ========================================================================== */

/* CSS Variables */
:root {
    --primary-color: #8B0000;
    --secondary-color: #DC143C;
    --accent-gold: #FFD700;
    --text-primary: #F5F5DC;
    --text-secondary: #D2B48C;
    --text-tertiary: #CD853F;
    --text-muted: #A0522D;
    --bg-primary: #3D2317;
    --bg-secondary: #2C1810;
    --bg-card: #4A2C17;
    --bg-input: #5A3C27;
    --border-color: #5A3C27;
    --error-color: #DC143C;
    --success-color: #228B22;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
}

/* ==========================================================================
   Login Container - Mobile-First Design
   ========================================================================== */

.login-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-content {
    background: transparent;
    padding: 40px 30px;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* ==========================================================================
   Logo Section - Creative Assembly Branding
   ========================================================================== */

.logo-section {
    text-align: center;
    margin-bottom: 50px;
    margin-top: -20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.brand-name {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 1.5px;
    margin: 0;
}

/* ==========================================================================
   Tab Section - Login/Register Toggle
   ========================================================================== */

.tab-section {
    display: flex;
    margin-bottom: 32px;
    background: var(--bg-card);
    border-radius: 25px;
    padding: 4px;
    position: relative;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 21px;
    position: relative;
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-light);
}

/* ==========================================================================
   Form Section - Modern Input Design
   ========================================================================== */

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Phone Input with Country Prefix */
.phone-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.1);
}

.country-prefix {
    padding: 16px 0 16px 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    border-right: 1px solid var(--border-color);
    margin-right: 12px;
}

.phone-input-wrapper input {
    flex: 1;
    height: 54px;
    padding: 16px 20px 16px 0;
    border: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 25px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.password-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.1);
}

.password-input-wrapper input {
    flex: 1;
    height: 54px;
    padding: 16px 50px 16px 20px;
    border: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    border-radius: 25px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.password-toggle:hover {
    background: rgba(139, 0, 0, 0.1);
    color: var(--text-secondary);
}

.input-group input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.input-group input.error {
    border-color: var(--error-color);
    background: rgba(220, 20, 60, 0.1);
}

/* Error Messages */
.error-message {
    font-size: 12px;
    color: var(--error-color);
    font-weight: 500;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: var(--transition);
    display: none;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* ==========================================================================
   Login Button - Prominent CTA
   ========================================================================== */

.login-btn {
    width: 100%;
    height: 54px;
    background: var(--primary-color);
    color: var(--text-primary);
    border: none;
    border-radius: 27px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-light);
}

.login-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--text-muted);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    font-weight: 500;
    border: 1px solid var(--border-color);
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.toast.error {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-content {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .logo-section {
        margin-bottom: 40px;
        margin-top: -15px;
    }
    
    .brand-name {
        font-size: 32px;
        font-weight: 800;
    }
    
    .tab-section {
        margin-bottom: 28px;
    }
    
    .tab-btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    .phone-input-wrapper input,
    .password-input-wrapper input {
        height: 50px;
        font-size: 15px;
    }
    
    .country-prefix {
        padding: 14px 0 14px 16px;
        font-size: 15px;
    }
    
    .login-btn {
        height: 50px;
        font-size: 15px;
    }
    
}

@media (max-width: 360px) {
    .login-content {
        padding: 28px 20px;
        max-width: 100%;
    }
    
    .logo-section {
        margin-top: -10px;
    }
    
    .brand-name {
        font-size: 28px;
        font-weight: 800;
    }
    
    .phone-input-wrapper input,
    .password-input-wrapper input {
        height: 48px;
        font-size: 14px;
    }
    
    .country-prefix {
        padding: 12px 0 12px 14px;
        font-size: 14px;
    }
    
    .login-btn {
        height: 48px;
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .login-container {
        max-width: 480px;
    }
    
    .login-content {
        padding: 48px 40px;
        max-width: 460px;
    }
    
    .logo-section {
        margin-bottom: 60px;
        margin-top: -30px;
    }
    
    .brand-name {
        font-size: 42px;
        font-weight: 800;
    }
    
    .tab-section {
        margin-bottom: 40px;
    }
    
    .tab-btn {
        padding: 14px 28px;
        font-size: 17px;
    }
    
    .phone-input-wrapper input,
    .password-input-wrapper input {
        height: 58px;
        font-size: 17px;
    }
    
    .country-prefix {
        padding: 18px 0 18px 24px;
        font-size: 17px;
    }
    
    .login-btn {
        height: 58px;
        font-size: 17px;
    }
    
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

.phone-input-wrapper:focus-within,
.password-input-wrapper:focus-within,
.login-btn:focus,
.tab-btn:focus {
    outline: 2px solid var(--skc-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .phone-input-wrapper,
    .password-input-wrapper {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
}