/* ============================================
   TAPSYNC PREMIUM LOGIN
   Exclusive Visual Identity
   ============================================ */

:root {
    --primary: #00f5d4;
    --primary-dark: #00c4a7;
    --secondary: #7b2cbf;
    --accent: #f72585;
    --gold: #ffd700;
    --dark-1: #0a0a0f;
    --dark-2: #12121a;
    --dark-3: #1a1a25;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --glow-primary: 0 0 30px rgba(0, 245, 212, 0.3);
    --glow-accent: 0 0 30px rgba(247, 37, 133, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--dark-1);
    color-scheme: dark;
    overflow-x: clip;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-1);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    overflow-x: clip;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    contain: strict;
    isolation: isolate;
    transform: translateZ(0);
    backface-visibility: hidden;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(123, 44, 191, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 245, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(247, 37, 133, 0.08) 0%, transparent 60%),
        var(--dark-1);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.85;
}

.orb-1 {
    width: 720px;
    height: 720px;
    top: -280px;
    left: -220px;
    background: radial-gradient(circle, rgba(123, 44, 191, 0.32) 0%, transparent 70%);
}

.orb-2 {
    width: 620px;
    height: 620px;
    bottom: -220px;
    right: -200px;
    background: radial-gradient(circle, rgba(0, 245, 212, 0.2) 0%, transparent 70%);
}

.orb-3 {
    width: 420px;
    height: 420px;
    top: 38%;
    left: 38%;
    opacity: 0.7;
    background: radial-gradient(circle, rgba(247, 37, 133, 0.16) 0%, transparent 70%);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -60px) scale(1.1); }
    50% { transform: translate(0, 60px) scale(0.9); }
    75% { transform: translate(-60px, -30px) scale(1.05); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* Floating Cards */
.floating-elements {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.float-card {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(18, 18, 26, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    animation: floatCard 20s ease-in-out infinite;
}

.card-1 { top: 15%; left: 10%; animation-delay: 0s; }
.card-2 { top: 25%; right: 15%; animation-delay: -5s; color: var(--secondary); }
.card-3 { bottom: 20%; left: 15%; animation-delay: -10s; color: var(--accent); }
.card-4 { bottom: 30%; right: 10%; animation-delay: -15s; }

@keyframes floatCard {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(10px) rotate(-3deg); }
    75% { transform: translateY(-15px) rotate(3deg); }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    min-height: 650px;
    display: flex;
    margin: 20px;
    background: rgba(12, 12, 18, 0.96);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
}

/* Branding Side */
.branding-side {
    flex: 1;
    padding: 60px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.08) 0%, rgba(123, 44, 191, 0.08) 100%);
    border-right: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.branding-side::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 245, 212, 0.1) 0%, transparent 50%);
    animation: rotateBg 30s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--gold), #ff8c00);
    color: var(--dark-1);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 30px;
    margin-bottom: 25px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Logo Image Styles */
.brand-logo {
    margin-bottom: 20px;
}

.logo-img-retangulo {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 40px rgba(0, 245, 212, 0.3));
    animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.brand-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -2px;
}

.brand-title .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'JetBrains Mono', monospace;
}

.brand-tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(0, 245, 212, 0.05);
    border-color: rgba(0, 245, 212, 0.2);
    transform: translateX(10px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--dark-1);
    flex-shrink: 0;
}

.feature-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Login Side */
.login-side {
    flex: 0 0 450px;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 360px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
}

/* Logo Quadrado na Página de Login */
.logo-img-square-login {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: var(--glow-primary);
    animation: logo-float 4s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0); box-shadow: var(--glow-primary); }
    50% { transform: translateY(-8px); box-shadow: 0 15px 40px rgba(0, 245, 212, 0.4); }
}

.logo {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: var(--glow-primary);
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-1);
}

.logo-glow {
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.5;
    filter: blur(15px);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.logo-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid var(--primary);
    border-radius: 30px;
    opacity: 0.3;
    animation: ring-pulse 2s ease-in-out infinite;
}

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

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Login Error */
.login-error {
    background: rgba(247, 37, 133, 0.1);
    border: 1px solid rgba(247, 37, 133, 0.3);
    color: var(--accent);
    padding: 15px 20px;
    border-radius: 14px;
    margin-bottom: 25px;
    display: none;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    animation: shake 0.5s ease;
}

.login-error.show {
    display: flex;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.input-icon {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 18px 50px 18px 55px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.input-group.focused .input-icon,
.input-group input:focus ~ .input-icon {
    color: var(--primary);
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(0, 245, 212, 0.03);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1), var(--glow-primary);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 0 0 14px 14px;
}

.input-group input:focus ~ .input-line {
    width: calc(100% - 2px);
}

.toggle-password {
    position: absolute;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Login Button */
.login-btn {
    position: relative;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 14px;
    color: var(--dark-1);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn .btn-text,
.login-btn .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn .btn-loading {
    display: none;
}

.login-btn.loading .btn-text {
    display: none;
}

.login-btn.loading .btn-loading {
    display: flex;
}

.login-btn .btn-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    z-index: -1;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn:hover .btn-glow {
    opacity: 0.6;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 245, 212, 0.3);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn:disabled {
    cursor: not-allowed;
    transform: none !important;
}

.login-btn.success {
    background: linear-gradient(135deg, #00c853, #00a844);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(10, 10, 15, 0.3);
    border-top-color: var(--dark-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

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

.divider span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Footer Links */
.footer-links {
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary);
    background: rgba(0, 245, 212, 0.05);
}

/* Secure Badge */
.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.secure-badge i {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    .branding-side {
        display: none;
    }

    .login-side {
        flex: 1;
        padding: 40px 30px;
    }

    .floating-elements {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-side {
        padding: 30px 20px;
    }

    .login-box {
        max-width: 100%;
    }

    .brand-title {
        font-size: 3rem;
    }
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--dark-1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-2);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 40px 25px;
    }

    .login-header h1 {
        font-size: 1.6rem;
    }
}

/* Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

html.is-scrolling *,
html.is-scrolling *::before,
html.is-scrolling *::after {
    animation-play-state: paused !important;
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .particle,
    .gradient-orb,
    .float-card {
        animation: none !important;
        display: none;
    }
}
