/* Base CSS - Estilos comuns para todas as calculadoras */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #e3e8ed;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #d1d5db;
    --primary-green: #16a34a;
    --primary-green-hover: #15803d;
    --primary-green-light: rgba(22, 163, 74, 0.1);
    --toggle-bg: #e5e7eb;
    --input-bg: #ffffff;
    --activity-bg: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Prevenir zoom em iOS */
input, select, textarea {
    font-size: 16px !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 100;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.back-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    color: var(--primary-green);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

/* Wrapper */
.wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 80px;
}

/* Container Principal */
.container {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.4s ease-out;
}

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

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-hover) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 14px 0 rgba(22, 163, 74, 0.3);
}

h1 {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -1px;
    display: inline-block;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    margin-top: 8px;
}

/* Form Base */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

label .label-icon {
    font-size: 16px;
    opacity: 0.7;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 400;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-field::placeholder {
    color: var(--text-light);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--primary-green-light);
    background: white;
}

/* Remove spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Input Grid */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 18px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-hover) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    letter-spacing: -0.2px;
    box-shadow: 0 4px 14px 0 rgba(22, 163, 74, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(22, 163, 74, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results Section */
.results {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--border-color);
    display: none;
    animation: fadeIn 0.5s ease;
}

.results.show {
    display: block;
}

.results-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.results-title::before {
    content: "📊";
    font-size: 24px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    gap: 12px;
}

.result-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.result-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    background: white;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.card-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 32px;
}

.loading.show {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* Info Section */
.info-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid var(--border-color);
}

.info-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-title::before {
    content: "💡";
    font-size: 20px;
}

.info-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 28px;
    position: relative;
}

.info-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--bg-card);
    padding: 24px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-content {
    max-width: 480px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.footer-divider {
    width: 40px;
    height: 2px;
    background: var(--primary-green);
    margin: 16px auto;
    border-radius: 2px;
}

.footer-copyright {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 8px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .back-button {
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
    }

    .wrapper {
        padding-top: 70px;
    }

    .container {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .logo-container {
        flex-direction: column;
        gap: 8px;
    }

    h1 {
        font-size: 28px;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-value {
        font-size: 22px;
    }
}

/* Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}
