html {
    background-color: var(--bg-dark);
    height: 100%;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0084ff;
    --primary-hover: #0073e6;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.login-container {
    padding: calc(2.5rem + env(safe-area-inset-top)) 2.5rem 2.5rem 2.5rem;
    width: 100%;
    max-width: 450px;
    position: relative;
}

/* Background effects */
.login-container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 132, 255, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(40px);
}

.login-box {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.logo {
    text-align: center;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo .logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.4);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.logo h1 span {
    color: var(--primary);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(0, 132, 255, 0.1);
}

button {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 132, 255, 0.4);
}

button:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-align: center;
    display: none;
    border-left: 3px solid var(--error);
}

.footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animations for interactions */
.error-vibrate {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }
    .login-box {
        padding: 1.5rem;
    }
}

.demo-section {
    margin-top: 1.5rem;
    text-align: center;
}

.divider {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 10px;
}

.btn-demo {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: var(--text-main);
}

.btn-demo:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-projeto {
    background: #6366f1; /* Indigo */
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-projeto:hover {
    background: #4f46e5;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}

/* MODAL & TUTORIAL */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tutorial-modal {
    max-width: 500px;
    padding: 40px;
    text-align: center;
    position: relative;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    box-shadow: none;
    width: auto;
    padding: 0;
    margin: 0;
}

.step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step.active {
    display: block;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    background: rgba(0, 132, 255, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.step h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.step p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.bullet-list {
    text-align: left;
    margin: 20px 0;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.bullet-list li {
    margin-bottom: 10px;
}

.step-note {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    font-size: 0.85rem !important;
    border-left: 4px solid var(--primary);
    margin-top: 20px;
    text-align: left;
}

.esquema-container {
    margin: 20px 0;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.esquema-container img {
    width: 100%;
    display: block;
    filter: brightness(0.9);
}

.tutorial-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.tutorial-actions button {
    width: auto;
    margin-top: 0;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.step-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: 0.3s;
}

.dot.active {
    background: var(--primary);
    transform: scale(1.4);
}

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

@media (max-width: 600px) {
    .tutorial-modal {
        padding: 25px;
        border-radius: 20px;
    }
    .step h2 { font-size: 1.3rem; }
    .step-icon { width: 60px; height: 60px; font-size: 2rem; }
}
