:root {
    --bg-dark: #0f0f13;
    --sidebar-bg: #14141a;
    --card-bg: #1a1a24;
    --primary-color: #8b5cf6; 
    --primary-hover: #7c3aed;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #272733;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning-bg: rgba(245, 158, 11, 0.1);
    --success-bg: rgba(16, 185, 129, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden; /* Prevent body scroll, handle scroll in main */
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ====== SIDEBAR ====== */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-top {
    padding: 24px 16px;
}

.logo {
    padding: 0 12px;
    margin-bottom: 40px;
}
.logo h3 {
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
}

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

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #9ab4d6; /* Bluish gray default */
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-item:hover:not(.disabled) {
    background-color: rgba(139, 92, 246, 0.1);
    color: #c5d4f0;
}

.menu-item.active {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.menu-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sidebar-bottom {
    padding: 24px 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    margin-bottom: 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ab4d6;
}

.user-email {
    font-size: 0.75rem;
    color: #64748b;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.logout-btn i {
    width: 20px;
    text-align: center;
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ====== MAIN CONTENT ====== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 900px;
}

.view-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 40px;
}

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

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

/* ====== PROGRESS HEADER ====== */
.progress-container {
    margin-bottom: 40px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-info strong {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-left: 12px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

/* ====== QUESTION CARDS ====== */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.question-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.options-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.option-btn {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.option-btn span:first-child {
    font-weight: 600;
    font-size: 1rem;
}

.option-btn span:last-child {
    font-size: 0.8rem;
    opacity: 0.7;
}

.option-btn:hover {
    background-color: var(--card-bg);
    border-color: #4b4b5c;
}

/* Selected States */
.option-btn.selected[data-points="0"] {
    background-color: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.option-btn.selected[data-points="5"] {
    background-color: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning);
}

.option-btn.selected[data-points="10"] {
    background-color: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

/* ====== BUTTONS ====== */
.actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    margin-bottom: 60px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* ====== DASHBOARD GRID ====== */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dash-top-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dash-top-left {
    display: flex;
    flex-direction: column;
}
.dash-top-left .title {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}
.dash-top-left .percent {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}
.dash-top-left .subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.dash-top-right {
    width: 300px;
    height: 8px;
    background-color: var(--bg-dark);
    border-radius: 4px;
    position: relative;
}
.dash-top-right .fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background-color: var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: width 0.5s ease;
}
.dash-top-right .fill::after {
    content: '';
    position: absolute;
    right: -6px; top: -4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.8);
}

.dash-alert {
    background-color: rgba(234, 179, 8, 0.05);
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: var(--warning);
    border-radius: 8px;
    padding: 16px 20px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-pillars-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.dash-pillar-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}
.dash-pillar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.dash-pillar-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background-color: var(--bg-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.dash-pillar-header-text {
    display: flex;
    flex-direction: column;
}
.dash-pillar-header-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.dash-pillar-header-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.dash-pillar-body {
    display: flex;
    align-items: center;
    gap: 20px;
}

.circular-chart {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.circular-chart::before {
    content: "";
    position: absolute;
    inset: 12px; /* thickness of ring */
    background-color: var(--card-bg);
    border-radius: 50%;
}
.dash-pillar-score-text {
    display: flex;
    flex-direction: column;
}
.dash-pillar-score-text .percent {
    font-size: 1.8rem;
    font-weight: 700;
}
.dash-pillar-score-text .points {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.dash-bottom-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}
.dash-bottom-card h3 {
    font-size: 1.1rem;
    margin-bottom: 24px;
}
.dash-bottom-grid {
    display: flex;
    align-items: center;
    gap: 40px;
}
.dash-stat-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.dash-stat-col:not(:last-child):after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background-color: var(--border-color);
}
.dash-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.dash-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ====== PROFILE ====== */
.profile-layout {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.large-avatar {
    width: 64px;
    height: 64px;
    font-size: 2rem;
}

.user-info-large h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.user-info-large p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.avatar-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.profile-form-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

.form-group label i {
    margin-right: 4px;
}

.form-group > input {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group > input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Input Wrapper for Dados Operacionais */
.input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.input-wrapper .prefix {
    padding: 14px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--border-color);
    margin-right: 12px;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 14px 16px 14px 0;
    outline: none;
    font-size: 0.95rem;
}

/* Ocultar as setinhas dos inputs number */
.input-wrapper input[type=number]::-webkit-inner-spin-button, 
.input-wrapper input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

.profile-actions {
    margin-top: 10px;
}

/* ====== AUTH OVERLAY ====== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
}

.auth-overlay.hidden {
    display: none !important;
}

.auth-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
}

.auth-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.auth-form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.auth-form-group input {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.auth-form-group input:focus {
    border-color: var(--primary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.auth-footer-link a:hover {
    text-decoration: underline;
}

.password-rules {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    font-size: 0.8rem;
}

.password-rules li {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.password-rules li.invalid {
    color: var(--text-secondary);
}

.password-rules li.valid {
    color: var(--success);
}

.password-rules li.invalid i {
    color: var(--danger);
}

.password-rules li.valid i {
    color: var(--success);
}

.w-full {
    width: 100%;
}

.mt-2 {
    margin-top: 12px;
}

.profile-footer-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 16px;
    text-align: center;
}
