:root {
    --primary-color: #10b981; /* Emerald/Green */
    --primary-hover: #059669;
    --secondary-color: #3b82f6; /* Blue */
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    --surface-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(203, 213, 225, 0.5);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
}

.app-header {
    background: var(--surface-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.header-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.header-container p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.app-main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-btn {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    color: var(--text-main);
    border-color: #cbd5e1;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Cards & Glassmorphism */
.glass-card {
    background: var(--surface-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.glass-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.glass-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.step-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

input[type="text"], input[type="number"], textarea, input[type="file"] {
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: #fff;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

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

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.w-full {
    width: 100%;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

/* Gabarito Modes */
.gabarito-mode {
    display: none;
    margin-bottom: 1rem;
}

.gabarito-mode.active {
    display: block;
}

.grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.grid-inputs .input-group {
    text-align: center;
}

.grid-inputs input {
    text-align: center;
    text-transform: uppercase;
}

/* Feedback Msg */
.feedback-msg {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    display: none;
}
.feedback-msg.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    display: block;
}
.feedback-msg.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

/* Global hidden class */
.hidden {
    display: none !important;
}

/* Loading Overlay */
#loading-overlay {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px dashed #cbd5e1;
}

.spinner {
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Bar */
#progress-container {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* Footer */
.app-footer {
    background: var(--surface-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem;
    margin-top: 10rem;
    color: var(--text-muted);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.footer-info {
    text-align: left;
}

.footer-info p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.footer-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

.footer-donate {
    text-align: center;
    background: #ffffff;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.footer-donate p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pix-qrcode {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    padding: 4px;
    background: white;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    .footer-info {
        text-align: center;
    }
    .footer-info p {
        justify-content: center;
    }
}

