/**
 * SynX Economy - Login Page
 * 
 * Design Premium com Animações e UI/UX Avançado
 * 
 * @version 3.0.0
 */

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */

.login-page {
    min-height: 100vh;
    background: var(--color-bg-primary);
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg__grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.login-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: glow-float 15s ease-in-out infinite;
}

.login-bg__glow--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
}

.login-bg__glow--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.1), transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

@keyframes glow-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
}

/* ============================================
   BRAND SECTION (Left Side)
   ============================================ */

.login-brand {
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(15, 15, 18, 0.95) 0%,
        rgba(10, 10, 12, 0.98) 100%
    );
    border-right: 1px solid var(--color-border);
    overflow: hidden;
}

.login-brand__content {
    position: relative;
    z-index: 2;
    max-width: 520px;
}

/* Logo */
.login-brand__logo {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
}

.login-brand__logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-brand__logo-icon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.3));
}

.login-brand__logo-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ============================================
   SHUFFLE TEXT ANIMATION - SLOT MACHINE
   ============================================ */

.shuffle-text {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 42px;
    font-weight: 800;
    color: #00FF41;
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1;
    display: inline-flex;
    cursor: default;
    position: relative;
    margin: 0;
    white-space: nowrap;
}

/* Glow on hover */
.shuffle-text:hover .shuffle-char,
.shuffle-text:hover .shuffle-char--static {
    text-shadow: 
        0 0 15px rgba(0, 255, 65, 0.9),
        0 0 30px rgba(0, 255, 65, 0.6),
        0 0 60px rgba(0, 255, 65, 0.4);
}

.shuffle-text--sub {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 6px;
}

/* Character wrapper - container com overflow hidden */
.shuffle-char-wrapper {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    position: relative;
}

/* Strip que desliza horizontalmente */
.shuffle-char-strip {
    display: inline-flex;
    flex-direction: row;
    will-change: transform;
}

/* Cada caractere individual */
.shuffle-char {
    display: inline-block;
    text-align: center;
    line-height: 1;
    color: #00FF41;
    text-shadow: 
        0 0 10px rgba(0, 255, 65, 0.5),
        0 0 20px rgba(0, 255, 65, 0.3);
    transition: text-shadow 0.3s ease;
}

.shuffle-char--final {
    color: #00FF41;
}

.shuffle-char--static {
    display: inline-block;
    color: #00FF41;
    text-shadow: 
        0 0 10px rgba(0, 255, 65, 0.5),
        0 0 20px rgba(0, 255, 65, 0.3);
    transition: text-shadow 0.3s ease;
}

/* Legacy support */
.login-brand__name {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
}

.login-brand__suffix {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-neon-green);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Headline */
.login-brand__headline {
    margin-bottom: 48px;
}

.login-brand__headline h1 {
    font-size: 42px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-neon-green) 0%, #00cc34 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand__headline p {
    font-size: 18px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Features */
.login-brand__features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: rgba(26, 26, 31, 0.6);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.login-feature:hover {
    background: rgba(26, 26, 31, 0.9);
    border-color: rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.login-feature__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.login-feature__icon svg {
    width: 22px;
    height: 22px;
    color: var(--color-neon-green);
}

.login-feature__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-feature__text strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.login-feature__text span {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* Stats */
.login-brand__stats {
    display: flex;
    gap: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.login-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-stat__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-neon-green);
}

.login-stat__label {
    font-size: 13px;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Pattern */
.login-brand__pattern {
    position: absolute;
    right: -100px;
    bottom: -100px;
    width: 500px;
    height: 500px;
    opacity: 0.6;
    pointer-events: none;
}

.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.05); }
}

/* ============================================
   FORM SECTION (Right Side)
   ============================================ */

.login-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    min-height: 100vh;
}

/* Mobile Logo */
.login-mobile-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-mobile-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-mobile-logo span {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
}

/* ============================================
   LOGIN CARD
   ============================================ */

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(26, 26, 31, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* ============================================
   TABS
   ============================================ */

.login-tabs {
    display: flex;
    position: relative;
    background: var(--color-bg-secondary);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 8px;
}

.login-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.login-tab svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.login-tab:hover {
    color: var(--color-text-secondary);
}

.login-tab.active {
    color: var(--color-neon-green);
}

.login-tab.active svg {
    opacity: 1;
}

.login-tab__indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--color-bg-card);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.login-tab[data-tab="register"].active ~ .login-tab__indicator {
    transform: translateX(100%);
}

/* ============================================
   FORMS
   ============================================ */

.login-forms {
    position: relative;
    padding: 32px 28px;
    min-height: 420px;
}

.login-form {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}

.login-form.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Header */
.login-form__header {
    text-align: center;
    margin-bottom: 28px;
}

.login-form__header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.login-form__header p {
    font-size: 14px;
    color: var(--color-text-tertiary);
}

/* Form Fields */
.login-form__fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 48px;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: var(--color-text-muted);
}

.input-wrapper input:hover {
    border-color: var(--color-border-light);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-neon-green);
    background: rgba(0, 255, 65, 0.03);
    box-shadow: 0 0 0 4px rgba(0, 255, 65, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--color-neon-green);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
    transition: color 0.2s ease;
}

.password-toggle:hover svg {
    color: var(--color-text-secondary);
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.password-strength__bar {
    display: flex;
    gap: 4px;
    flex: 1;
}

.password-strength__bar span {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength[data-strength="weak"] .password-strength__bar span:nth-child(1) {
    background: var(--color-error);
}

.password-strength[data-strength="medium"] .password-strength__bar span:nth-child(1),
.password-strength[data-strength="medium"] .password-strength__bar span:nth-child(2) {
    background: var(--color-warning);
}

.password-strength[data-strength="strong"] .password-strength__bar span:nth-child(1),
.password-strength[data-strength="strong"] .password-strength__bar span:nth-child(2),
.password-strength[data-strength="strong"] .password-strength__bar span:nth-child(3) {
    background: var(--color-neon-green);
}

.password-strength[data-strength="very-strong"] .password-strength__bar span {
    background: var(--color-neon-green);
}

.password-strength__text {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    min-width: 80px;
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--color-bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--color-neon-green);
    border-color: var(--color-neon-green);
}

.checkbox-wrapper input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-wrapper a {
    color: var(--color-neon-green);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.checkbox-wrapper a:hover {
    opacity: 0.8;
}

/* Forgot Link */
.forgot-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-neon-green);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.btn-submit {
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--color-neon-green) 0%, #00cc34 100%);
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-submit:hover::before {
    opacity: 1;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-submit:hover svg {
    transform: translateX(4px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   DIVIDER & SOCIAL
   ============================================ */

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.login-divider span {
    font-size: 13px;
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.social-login {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn svg {
    width: 22px;
    height: 22px;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

.social-btn:hover:not(:disabled) {
    background: var(--color-bg-card-hover);
    border-color: var(--color-border-light);
}

.social-btn:hover:not(:disabled) svg {
    color: var(--color-text-primary);
}

.social-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FOOTER
   ============================================ */

.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.login-footer__links {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.login-footer__links a {
    font-size: 13px;
    color: var(--color-text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer__links a:hover {
    color: var(--color-neon-green);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 1024px) {
    .login-brand {
        display: flex;
    }
    
    .login-mobile-logo {
        display: none;
    }
    
    .login-form-section {
        max-width: 1000px;
    }
}

@media (min-width: 1280px) {
    .login-brand {
        padding: 80px;
    }
    
    .login-brand__headline h1 {
        font-size: 48px;
    }
}

@media (max-width: 480px) {
    .login-form-section {
        padding: 24px 16px;
    }
    
    .login-card {
        border-radius: 20px;
    }
    
    .login-forms {
        padding: 24px 20px;
    }
    
    .login-tabs {
        border-radius: 14px;
    }
    
    .login-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .login-tab svg {
        width: 16px;
        height: 16px;
    }
    
    .input-wrapper input {
        height: 48px;
        font-size: 14px;
    }
    
    .btn-submit {
        height: 50px;
        font-size: 15px;
    }
    
    .login-brand__features {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ANIMATIONS & EFFECTS
   ============================================ */

/* Input focus glow effect */
.input-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-neon-green), transparent);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.input-wrapper:focus-within::after {
    opacity: 0.1;
}

/* Loading state */
.btn-submit.loading {
    pointer-events: none;
}

.btn-submit.loading span {
    opacity: 0;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top-color: var(--color-bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.input-wrapper.error input {
    border-color: var(--color-error);
    background: rgba(255, 71, 87, 0.05);
}

.input-wrapper.error .input-icon {
    color: var(--color-error);
}

/* Success state */
.input-wrapper.success input {
    border-color: var(--color-neon-green);
}

.input-wrapper.success .input-icon {
    color: var(--color-neon-green);
}
