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

:root {
    --bg: #06060c;
    --bg-card: rgba(18, 18, 31, 0.75);
    --bg-input: rgba(0, 0, 0, 0.35);
    --border: rgba(139, 92, 246, 0.22);
    --purple: #8b5cf6;
    --purple-dark: #6d28d9;
    --purple-light: #c084fc;
    --purple-glow: rgba(139, 92, 246, 0.35);
    --text: #ffffff;
    --text-muted: #9ca3af;
    --success: #16a34a;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --gradient-hero: linear-gradient(135deg, #06060c 0%, #1a1035 40%, #12082a 70%, #06060c 100%);
    --gradient-btn: linear-gradient(135deg, #7c3aed, #a78bfa);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ——— Tema roxo global (todas as páginas) ——— */
.site-theme {
    background: var(--bg);
    overflow-x: hidden;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient span {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: floatOrb 20s ease-in-out infinite;
}

.ambient .orb-1 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.5) 0%, transparent 70%);
    top: -140px;
    right: -100px;
    opacity: 0.55;
}

.ambient .orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(109, 40, 217, 0.45) 0%, transparent 70%);
    bottom: 5%;
    left: -120px;
    animation-delay: -7s;
    opacity: 0.45;
}

.ambient .orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.35) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.3;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-16px, 20px) scale(1.05); }
}

.ambient .orb-3 {
    animation-name: floatOrbCenter;
}

@keyframes floatOrbCenter {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(calc(-50% - 20px), calc(-50% + 16px)) scale(1.06); }
}

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

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5%;
    background: rgba(6, 6, 12, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--purple);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo i {
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(139, 92, 246, 0.15);
}

.btn-primary,
.btn-secondary,
.btn-login,
.btn-save {
    padding: 12px 20px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.25s;
}

.btn-primary,
.btn-login,
.btn-save {
    background: var(--gradient-btn);
    color: white;
    box-shadow: 0 4px 20px var(--purple-glow);
}

.btn-primary:hover,
.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--purple);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-login {
    text-decoration: none;
}

.btn-back {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-back:hover {
    color: white;
    border-color: var(--purple);
}

.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 60px 5%;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%238b5cf6' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

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

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 16px 0;
    font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(135deg, #fff 20%, #c4b5fd 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 520px;
}

.tag {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    display: inline-block;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

section {
    padding: 80px 5%;
    position: relative;
}

section h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: #fff;
}

.dashboard,
.chat {
    background: linear-gradient(180deg, transparent, rgba(26, 16, 53, 0.4) 50%, transparent);
}

.section-sub {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple), var(--purple-light), transparent);
    opacity: 0.6;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 16px 48px rgba(139, 92, 246, 0.15);
}

.card h3 {
    font-size: 2rem;
    color: var(--purple-light);
}

.card p {
    color: var(--text-muted);
    margin-top: 6px;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.chat-box {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    max-height: 360px;
    overflow-y: auto;
}

.message {
    padding: 14px 18px;
    border-radius: 14px;
}

.user-message {
    background: rgba(109, 40, 217, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.coach-message {
    background: rgba(139, 92, 246, 0.25);
    border: 1px solid rgba(192, 132, 252, 0.2);
}

.chat-input {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.chat-input input {
    flex: 1;
    min-width: 200px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(139, 92, 246, 0.35);
}

/* ——— Login ——— */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 60px rgba(139, 92, 246, 0.1);
}

.auth-card .logo {
    justify-content: center;
    margin-bottom: 28px;
    font-size: 1.5rem;
}

.auth-card h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: -8px;
}

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    justify-content: center;
}

.auth-alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    margin-bottom: 16px;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.auth-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

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

.auth-footer .btn-secondary {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

/* ——— Chat página ——— */
.chat-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 5% 80px;
}

.chat-page h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.chat-page h2 i {
    color: var(--purple-light);
}

.site-footer {
    text-align: center;
    padding: 32px 5%;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: rgba(6, 6, 12, 0.6);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ——— Página Alunos ——— */

.app-page {
    padding: 24px 5% 120px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    color: var(--text-muted);
    margin-top: 6px;
}

.alunos-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.student-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    position: sticky;
    top: 88px;
}

.student-sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.student-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: var(--bg-input);
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
    width: 100%;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
}

.student-item:hover {
    border-color: var(--border);
}

.student-item.active {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.15);
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.student-meta span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-panel {
    min-width: 0;
}

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: white;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

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

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.info-card h3 {
    font-size: 1rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--purple-light);
}

.info-card h3 i {
    opacity: 0.9;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group label i {
    margin-right: 4px;
    color: var(--purple);
    width: 14px;
}

.pref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.pref-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.pref-item h4 {
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--purple-light);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: 0.2s;
}

.checkbox-group input {
    width: auto;
    accent-color: var(--purple);
}

.checkbox-group label:has(input:checked) {
    border-color: var(--purple);
    color: white;
    background: rgba(139, 92, 246, 0.12);
}

.results-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 720px;
}

.results-table th,
.results-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.results-table th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.results-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.06);
}

.results-table td {
    color: #e5e7eb;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--purple);
    margin-bottom: 16px;
    opacity: 0.6;
}

.save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 5%;
    background: rgba(8, 8, 15, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    z-index: 90;
}

.save-bar .btn-save {
    width: 100%;
    max-width: 400px;
    justify-content: center;
    padding: 16px 24px;
    font-size: 1rem;
}

.toast {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--success);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    transform: translateX(120%);
    transition: transform 0.35s ease;
    box-shadow: var(--shadow);
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #dc2626;
}

.mini-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.mini-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.mini-card .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--purple-light);
}

.mini-card .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 900px) {
    .alunos-layout {
        grid-template-columns: 1fr;
    }

    .student-sidebar {
        position: static;
    }

    .student-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .student-item {
        min-width: 200px;
        flex-shrink: 0;
    }

    .nav-links {
        display: none;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        flex: 0 0 auto;
    }
}

@media (max-width: 600px) {
    .navbar {
        padding: 12px 4%;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    section {
        padding: 60px 4%;
    }

    .app-page {
        padding: 16px 4% 110px;
    }
}
