* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #000000;
    --surface: #0a0a0a;
    --text: #ffffff;
    --text-muted: #666666;
    --accent: #ffffff;
    --border: #1a1a1a;
    --hover: #1a1a1a;
}

:root[data-theme="light"] {
    --bg: #f8f8f8;
    --surface: #f0f0f0;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --accent: #2a2a2a;
    --border: #d5d5d5;
    --hover: #e8e8e8;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Background Effects - Mantendo o fundo novo */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    z-index: 0;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

#codeCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.logo {
    margin-bottom: 50px;
    text-align: center;
    position: relative;
}

.beta-badge {
    position: absolute;
    top: -8px;
    right: -45px;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 4px 10px;
    border-radius: 2px;
    text-transform: uppercase;
    animation: betaPulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes betaPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    color: var(--accent);
    opacity: 0.9;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 8px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    position: relative;
    gap: 8px;
}

.logo-part {
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.logo-rux {
    font-weight: 400;
    letter-spacing: 10px;
    color: var(--text);
}

.logo-api {
    font-weight: 300;
    letter-spacing: 6px;
    color: var(--text-muted);
    opacity: 0.8;
}

.logo-separator {
    width: 2px;
    height: 24px;
    background: var(--accent);
    opacity: 0.3;
    display: inline-block;
    margin: 0 4px;
    animation: separatorPulse 2s ease-in-out infinite;
}

@keyframes separatorPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.6;
        transform: scaleY(1.2);
    }
}

.logo-text::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    animation: logoLine 1s ease-out 0.5s forwards;
}

@keyframes logoLine {
    to {
        transform: scaleX(1);
    }
}

.form-container {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 18px;
    font-size: 0.95rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    text-transform: uppercase;
    font-weight: 300;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tab-btn.active {
    color: var(--text);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-btn:hover:not(.active) {
    color: var(--text);
    background: var(--hover);
}

.form-wrapper {
    padding: 35px 30px;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(30px) scale(0.98);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.6s;
    pointer-events: none;
    will-change: transform, opacity;
}

.form-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    pointer-events: all;
    position: relative;
}

.form-wrapper.slide-out {
    transform: translateX(-30px) scale(0.98);
    opacity: 0;
}

.form-container {
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    padding: 10px 0;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-bottom-color: var(--accent);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    transform: translateY(-26px) scale(0.8);
    color: var(--accent);
}

.input-group label {
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.85rem;
}

.remember {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 300;
}

.remember input {
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--accent);
}

.forgot-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 300;
}

.forgot-link:hover {
    color: var(--text);
}

.btn-submit {
    width: 100%;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--bg);
    padding: 14px;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .btn-submit {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

[data-theme="light"] .btn-submit:hover {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

.btn-submit:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-submit::before {
    background: rgba(255, 255, 255, 0.1);
}

.btn-submit span {
    position: relative;
    z-index: 1;
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    stroke: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
}

.sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .moon-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* Ajustes para tema claro */
[data-theme="light"] .bg-gradient {
    background: radial-gradient(circle at 20% 50%, rgba(0, 0, 0, 0.015) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.01) 0%, transparent 50%);
}

[data-theme="light"] .grid-pattern {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.01) 1px, transparent 1px);
    opacity: 0.5;
}

[data-theme="light"] #codeCanvas {
    opacity: 0.05;
}

[data-theme="light"] .logo-separator {
    background: var(--accent);
    opacity: 0.4;
}

[data-theme="light"] .logo-api {
    color: var(--text-muted);
}

/* Comet Effect */
.comet-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    overflow: hidden;
}

.comet {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 
        0 0 10px var(--accent),
        0 0 20px var(--accent),
        0 0 30px var(--accent);
    animation: cometFall 3s ease-out forwards;
}

.comet-1 {
    top: -20px;
    left: -20px;
    animation-delay: 0s;
}

.comet-2 {
    top: 80px;
    left: -20px;
    animation-delay: 0.8s;
}

.comet::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        rgba(255, 255, 255, 0.9) 20%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.2) 80%,
        transparent 100%
    );
    transform: translate(-50%, -50%) rotate(-45deg);
    transform-origin: left center;
    filter: blur(0.5px);
}

.comet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.4) 40%,
        rgba(255, 255, 255, 0.1) 70%,
        transparent 100%
    );
    transform: translate(-50%, -50%) rotate(-45deg);
    transform-origin: left center;
    filter: blur(1.5px);
}

@keyframes cometFall {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(100vw + 100px), calc(100vh + 100px)) scale(1);
    }
}

.comet-2::before {
    width: 160px;
    transform: translate(-50%, -50%) rotate(-50deg);
}

.comet-2::after {
    width: 110px;
    transform: translate(-50%, -50%) rotate(-50deg);
}

@media (max-width: 480px) {
    .beta-badge {
        top: -6px;
        right: -30px;
        font-size: 0.55rem;
        padding: 3px 8px;
    }
    
    .logo-text {
        font-size: 2rem;
        letter-spacing: 8px;
    }

    .form-wrapper {
        padding: 30px 25px;
    }

    .form-container {
        max-width: 100%;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .theme-icon {
        width: 18px;
        height: 18px;
    }
}
