@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --bg: #f4f6fb;
    --bg-grad: radial-gradient(1200px 600px at 10% -10%, #e0e7ff 0%, transparent 60%),
               radial-gradient(900px 500px at 100% 0%, #dbeafe 0%, transparent 55%),
               linear-gradient(180deg, #f6f8fc 0%, #eef2f9 100%);
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-700: #1e40af;
    --primary-grad: linear-gradient(135deg, #3b82f6 0%, #6366f1 60%, #8b5cf6 100%);

    --danger: #ef4444;
    --success: #10b981;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 6px 20px -8px rgba(15, 23, 42, .15), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg: 0 20px 40px -20px rgba(37, 99, 235, .35), 0 6px 14px rgba(15, 23, 42, .08);

    --nav-grad: linear-gradient(120deg, #0b1220 0%, #111827 45%, #1e293b 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; min-width: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.25;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
h1 { font-size: clamp(1.4rem, 5vw, 2.1rem); margin-bottom: .25em; }
h2 { font-size: clamp(1.2rem, 4vw, 1.7rem); margin-bottom: .6em; }
h3 { font-size: clamp(.95rem, 3vw, 1.05rem); margin-bottom: .4em; }

p { color: #334155; overflow-wrap: break-word; }

.header {
    background: var(--nav-grad);
    color: white;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .8);
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: saturate(140%) blur(8px);
}

.navbar {
    max-width: 1200px;
    margin: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px clamp(14px, 3vw, 24px);
    gap: 10px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: clamp(16px, 2.5vw, 20px);
    color: white;
    text-decoration: none;
    margin-right: 28px;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity .2s;
}
.navbar-brand:hover { opacity: .85; }

.navbar-icon {
    width: 26px;
    margin-right: 10px;
    filter: drop-shadow(0 2px 6px rgba(99,102,241,.5));
    -webkit-text-fill-color: initial;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    position: relative;
}
.nav-toggle::before,
.nav-toggle::after,
.nav-toggle span {
    content: "";
    position: absolute;
    left: 10px; right: 10px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle::before { top: 13px; }
.nav-toggle span { top: 19px; }
.nav-toggle::after { top: 25px; }

#nav-toggle { display: none; }
#nav-toggle:checked ~ .navbar .nav-toggle::before { transform: translateY(6px) rotate(45deg); }
#nav-toggle:checked ~ .navbar .nav-toggle span { opacity: 0; }
#nav-toggle:checked ~ .navbar .nav-toggle::after { transform: translateY(-6px) rotate(-45deg); }

.navbar-nav {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
    gap: 4px 6px;
}

.nav-item { margin-right: 6px; }

.nav-link {
    text-decoration: none;
    color: #cbd5e1;
    font-size: 14.5px;
    font-weight: 500;
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all .2s ease;
    position: relative;
    min-height: 40px; /* touch target */
    line-height: 20px;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: white;
    background: rgba(255,255,255,.07);
    outline: none;
}

#right { margin-left: auto; }
#right + #right { margin-left: 0; }

.main {
    max-width: 1200px;
    margin: auto;
    padding: clamp(20px, 4vw, 40px) clamp(14px, 3vw, 24px) clamp(32px, 5vw, 60px);
    animation: fadeUp .5s ease both;
}

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

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    background: transparent;
}

.main > .table {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    table-layout: auto;
}


.table th,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14.5px;
    white-space: normal;
}

.table th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .06em;
}

.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background-color: #f8faff; }
.table tbody tr:last-child td { border-bottom: none; }
.table td { color: #1e293b; font-variant-numeric: tabular-nums; }

.link {
    background: var(--primary-grad);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-block;
    min-height: 40px;
    line-height: 20px;
    box-shadow: 0 4px 12px -4px rgba(99,102,241,.5);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.link:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(99,102,241,.6); filter: brightness(1.05); }
.link:active { transform: translateY(0); }

.ask-link {
    color: rgb(34, 0, 255);
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-block;
    min-height: 40px;
    line-height: 20px;
    box-shadow: 0 4px 12px -4px rgba(99,102,241,.5);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.ask-link:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(99,102,241,.6); filter: brightness(1.05); }
.ask-link:active { transform: translateY(0); }

form { margin-top: 24px; }
form > div { margin-bottom: 12px; }

input, textarea, select {
    padding: 12px 14px;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 16px; /* >=16px previne zoom no iOS */
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

@media (min-width: 640px) {
    form > div > input:not([type="checkbox"]):not([type="radio"]) { width: 320px; }
}

input::placeholder, textarea::placeholder { color: #94a3b8; }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

button {
    padding: 12px 22px;
    border: none;
    background: var(--primary-grad);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: .01em;
    min-height: 44px;
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.55);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(99,102,241,.65); filter: brightness(1.05); }
button:active { transform: translateY(0); }

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.card {
    background: var(--surface);
    padding: 22px 22px 20px;
    border-radius: var(--radius-lg);
    min-width: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .25s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--primary-grad);
    opacity: .6;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.card p {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

#principal { background: var(--primary-grad); color: white; border: none; }
#principal::before { background: rgba(255,255,255,.4); opacity: 1; }
#principal h3 { color: rgba(255,255,255,.85); }
#principal p { color: white; }

.chart-container {
    margin-top: 32px;
    background: var(--surface);
    padding: clamp(14px, 3vw, 24px);
    border-radius: var(--radius-lg);
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.chart-container canvas,
.chart-container svg { max-width: 100%; height: auto; }

#total {
    margin-top: 14px;
    font-weight: 600;
    color: var(--primary-700);
    font-variant-numeric: tabular-nums;
}

.main > h3 {
    margin-top: 22px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    box-shadow: var(--shadow-sm);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.footer {
    margin-top: clamp(40px, 8vw, 70px);
    background: var(--nav-grad);
    color: white;
    padding: clamp(28px, 5vw, 40px) clamp(16px, 3vw, 24px) clamp(24px, 4vw, 32px);
    border-top: 1px solid rgba(255,255,255,.06);
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

.footer-content > p { color: #94a3b8; font-size: 14px; }

.contact-links {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 12px;
    padding: 0;
}

.contact-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all .2s ease;
    display: inline-block;
    min-height: 40px;
    line-height: 24px;
}

.contact-links a:hover { color: white; background: rgba(255,255,255,.08); }

.apology-container {
    text-align: center;
    margin: 80px auto 0;
    padding: clamp(24px, 5vw, 40px) clamp(16px, 4vw, 20px);
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    max-width: 560px;
    width: calc(100% - 24px);
    border: 1px solid var(--border);
}

.apology-title {
    font-size: clamp(22px, 5vw, 32px);
    color: var(--danger);
    margin-bottom: 16px;
    font-weight: 800;
}

.apology-message {
    font-size: clamp(15px, 3vw, 17px);
    margin-bottom: 28px;
    color: #475569;
}

.apology-button {
    padding: 12px 22px;
    background: var(--primary-grad);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    display: inline-block;
    font-weight: 600;
    min-height: 44px;
    line-height: 20px;
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.55);
    transition: transform .15s ease, filter .2s ease;
}
.apology-button:hover { transform: translateY(-1px); filter: brightness(1.05); }

.main ul { padding-left: 20px; color: #475569; }
.main ul li { margin: 4px 0; }

.contact-section { margin-top: 24px; }

.contact-section h3 {
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 20px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
    align-items: stretch;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.contact-info a {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    color: #cbd5e1;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    padding: 14px 16px;
    border-radius: var(--radius);
    transition: all .2s ease;
    min-height: 48px;
    overflow-wrap: anywhere;
}
.contact-info a:hover { color: white; background: rgba(255,255,255,.08); transform: translateY(-2px); }
.contact-info i { font-size: 17px; flex-shrink: 0; }

.contact-form {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-lg);
    padding: clamp(16px, 4vw, 22px);
    margin-top: 0;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    align-items: flex-start;
    width: 100%;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: white;
}

.contact-form textarea {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.contact-form textarea::placeholder,
.contact-form input::placeholder { color: #94a3b8; }

.contact-form textarea:focus,
.contact-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

.contact-form button { width: 100%; margin-top: 4px; }

.about-container { max-width: 900px; margin: auto; }
.about-title { margin-bottom: 24px; }

.about-text {
    margin-bottom: 20px;
    font-size: clamp(15px, 2.5vw, 16px);
    line-height: 1.8;
    color: #475569;
}

.about-list { margin: 18px 0 28px 20px; }
.about-list li { margin-bottom: 10px; color: #475569; }

.about-tech { margin-top: 40px; }
.about-tech h2 { margin-bottom: 18px; }

.about-tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.about-tech-grid span {
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.about-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

.yellow { color: yellow; }
.red { color: red; }

.profile-pic {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid var(--border);
}

.success {
    color: var(--success);
    font-weight: 600;
}

@media (max-width: 900px) {
    .navbar { gap: 8px; }
}

@media (max-width: 768px) {
    .navbar-brand { margin-right: 0; }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 10px;
        gap: 4px;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }

    /* Quando há checkbox toggle, expande o menu */
    #nav-toggle:checked ~ .navbar .navbar-nav { max-height: 600px; }

    /* Sem JS / sem toggle: sempre visível */
    body:not(:has(#nav-toggle)) .navbar-nav { max-height: none; }

    .nav-toggle { display: block; }

    .nav-item { margin-right: 0; width: 100%; }
    .nav-link { display: block; padding: 12px 14px; width: 100%; }

    #right { margin-left: 0; }

    .dashboard { grid-template-columns: 1fr; gap: 14px; }

    .apology-container { margin-top: 40px; }
}

@media (max-width: 480px) {
    .navbar { padding: 10px 14px; }

    .table th, .table td { padding: 10px 12px; font-size: 13.5px; }

    .footer { margin-top: 32px; }

    .contact-links { flex-direction: column; align-items: stretch; gap: 6px; }
    .contact-links a { text-align: center; }

    .about-buttons { flex-direction: column; }
    .about-buttons .link,
    .about-buttons .ask-link,
    .about-buttons button { width: 100%; text-align: center; }
}

@media (max-width: 360px) {
    .main { padding: 16px 10px 28px; }
    .card { padding: 18px 16px; }
    h1 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
