/* UI avançada - layout e micro-interações */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    min-height: 100%;
}

.app-body {
    background: radial-gradient(1200px 600px at 10% -10%, rgba(79, 107, 255, 0.18), transparent 60%),
                radial-gradient(900px 450px at 90% -20%, rgba(23, 227, 255, 0.14), transparent 60%),
                var(--bg-main);
}

body.bg-gray-50 {
    background: var(--bg-main);
}

.auth-body {
    background: radial-gradient(900px 400px at 50% -20%, rgba(79, 107, 255, 0.24), transparent 70%),
                var(--bg-main);
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-shell {
    position: relative;
    width: min(520px, 92vw);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.auth-brand {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

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

.auth-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: var(--glow);
}

.auth-logo i {
    width: 26px;
    height: 26px;
}

.auth-alert {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-field {
    display: grid;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-field input {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.18);
    outline: none;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    padding: 0.95rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-chip {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(79, 107, 255, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.auth-orbit {
    position: absolute;
    inset: -10% -5%;
    border-radius: 24px;
    border: 1px dashed rgba(79, 107, 255, 0.18);
    pointer-events: none;
}

.btn-primary,
.input-cmd,
.card,
.panel {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.input-cmd:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.18);
    outline: none;
}

.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, rgba(79, 107, 255, 0.9), rgba(23, 227, 255, 0.8));
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.dark-mode .dark-mode-toggle {
    background: linear-gradient(135deg, rgba(100, 120, 255, 0.9), rgba(248, 107, 255, 0.75));
}

@media (max-width: 768px) {
    .dark-mode-toggle {
        width: 46px;
        height: 46px;
        bottom: 16px;
        right: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .modal-enter {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary,
    .input-cmd,
    .card,
    .panel,
    .dark-mode-toggle {
        transition: none;
    }
}
