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

html, body {
    overflow-x: hidden;
}

/* Esconder scrollbar visual mas permitir scroll */
body::-webkit-scrollbar {
    display: none;
}
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

:root {
    --bg: #f0f4f3;
    --surface: #ffffff;
    --surface2: #e8eeec;
    --accent: #22c55e;
    --accent-dim: #16a34a;
    --text: #1a2e2a;
    --text2: #5f7c75;
    --danger: #dc2626;
    --warn: #d97706;
    --radius: 14px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.screen {
    animation: fadeUp 0.3s ease;
}

.screen-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 0;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header.compact {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    margin-bottom: 20px;
}

.header h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.header h2 { font-size: 1.1rem; font-weight: 700; }
.header-info { flex: 1; }

.badge {
    display: inline-block;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.tag {
    font-size: 0.78rem;
    color: var(--text2);
    font-weight: 500;
}

.sub {
    color: var(--text2);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Input hero (matrícula) */
.input-hero {
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 16px;
    border: 2px solid var(--surface2);
    transition: border-color 0.2s;
}

.input-hero:focus-within {
    border-color: var(--accent);
}

.input-hero input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    font-family: inherit;
    padding: 12px 8px;
    min-width: 0;
}

.input-hero input::placeholder {
    color: #c5d0cd;
}

.btn-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    flex-shrink: 0;
}

.btn-icon:active { transform: scale(0.92); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }

/* Buttons */
.btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--bg);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    margin-top: 20px;
}

.btn-main:active { transform: scale(0.97); }
.btn-main:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-main.btn-idle {
    background: var(--surface2);
    color: var(--text2);
    pointer-events: none;
}

.btn-ghost {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--surface2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text2);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    padding: 12px;
    width: 100%;
    transition: color 0.2s;
}

.link-btn:hover { color: var(--accent); }

/* Progress bar */
.progress-bar {
    height: 4px;
    background: var(--surface2);
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sections */
.section {
    margin-bottom: 24px;
}

.section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    margin-bottom: 12px;
}

.section h3 .material-icons-round {
    font-size: 18px;
    color: var(--accent);
}

/* Chips (checkboxes) */
.chip-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: 1px solid transparent;
    user-select: none;
}

.chip:active { transform: scale(0.98); }

.chip-on {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.3);
}

.chip-icon {
    font-size: 22px;
    color: #c5d0cd;
    transition: color 0.2s;
}

.chip-on .chip-icon {
    color: var(--accent);
}

.chip-label {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    word-break: break-word;
    text-transform: uppercase;
}

.chip-label small {
    font-size: 0.75rem;
    color: var(--text2);
    font-weight: 400;
}

.chip-tipo {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    color: var(--accent-dim);
}

/* Chip nota (tipo 1) */
.chip-nota {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--surface2);
    user-select: none;
    flex-wrap: wrap;
}

.chip-nota .chip-icon {
    color: var(--warn);
}

.input-nota {
    width: 64px;
    padding: 8px 10px;
    background: var(--surface2);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    outline: none;
    margin-left: auto;
    transition: border-color 0.2s;
}

.input-nota:focus {
    border-color: var(--accent);
}

/* Form */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}

.field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.field input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 2px solid var(--surface2);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus {
    border-color: var(--accent);
}

.field input::placeholder {
    color: #a0b0ab;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}

.modal-overlay.modal-visible {
    opacity: 1;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.2s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-visible .modal {
    transform: scale(1);
}

.modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.modal p {
    font-size: 0.88rem;
    color: var(--text2);
    margin-bottom: 24px;
}

.modal-btns {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s;
}

.modal-btn:active { transform: scale(0.96); }

.modal-cancel {
    background: var(--surface2);
    color: var(--text);
}

.modal-confirm {
    background: var(--danger);
    color: #fff;
}

/* Alert dialog */
.alert-dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.alert-dialog-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.alert-info .alert-dialog-icon { color: #0284c7; }
.alert-error .alert-dialog-icon { color: var(--danger); }
.alert-warn .alert-dialog-icon { color: var(--warn); }

.alert-dialog-btn {
    width: 100%;
    margin-top: 8px;
    background: var(--accent);
    color: var(--bg);
}

/* Support pill */
.support-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 30px;
    font-size: 0.72rem;
    color: var(--text2);
    flex-wrap: wrap;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.support-pill:hover {
    background: var(--surface2);
}

.support-pill .material-icons-round {
    font-size: 16px;
    color: var(--accent-dim);
}

/* Icons & misc */
.icon-huge {
    font-size: 72px;
    color: var(--accent);
}

.faded { opacity: 0.4; }

.mt-16 { margin-top: 16px; }

/* Loading */
.pulse-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--accent);
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.loading-text {
    margin-top: 20px;
    color: var(--text2);
    font-size: 0.9rem;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(0,0,0,0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.success-burst {
    position: relative;
}

.success-icon {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
