/* Defaults — dark (matches drortolan main page night theme) */
:root {
    --bg: #0f172a;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.06);
    --ink: #f8fafc;
    --ink-light: #cbd5e1;
    --mango: #f6b84b;
    --mango-glow: rgba(246, 184, 75, 0.4);
    --border: rgba(255, 255, 255, 0.14);
    --btn-bg: #f6b84b;
    --btn-text: #0f172a;
}

/* Day theme — when shell switches to light */
html[data-theme="day"] {
    --bg: #fbfbfb;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --ink: #0f172a;
    --ink-light: #475569;
    --border: #e2e8f0;
    --btn-bg: #0f172a;
    --btn-text: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
h1, h3, .badge { font-family: 'Georgia', serif; }

.app-container { max-width: 800px; margin: 0 auto; padding: 2rem 1rem; }
.header { text-align: center; margin-bottom: 3rem; }
.badge { display: inline-block; background: var(--mango); color: #0f172a; padding: 0.4rem 1rem; border-radius: 30px; font-size: 0.8rem; margin-bottom: 1rem; font-weight: 700; }
.header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.header p { color: var(--ink-light); }

.calculator { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 600px) { .input-grid { grid-template-columns: 1fr; } }

.eye-card { background: var(--surface-2); padding: 1.5rem; border-radius: 15px; border: 1px solid var(--border); }
.eye-card h3 { font-size: 1.1rem; margin-bottom: 1.2rem; border-bottom: 2px solid var(--mango); display: inline-block; }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink-light); }
.cyl-alert { font-size: 0.7rem; color: #d97706; font-weight: 800; margin-top: 0.3rem; display: none; text-transform: uppercase; }

/* Tooltips didáticos nos campos */
.field-info { margin-top: 0.5rem; border-top: 1px solid #f1f5f9; padding-top: 0.4rem; }
.field-info summary { font-size: 0.7rem; font-weight: 700; color: var(--mango); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.3rem; }
.field-info summary::before { content: "ℹ️"; font-size: 0.75rem; }
.field-info p { font-size: 0.7rem; color: #64748b; line-height: 1.4; margin-top: 0.3rem; padding-left: 1.1rem; }
.field-info[open] summary { margin-bottom: 0.3rem; }

input { width: 100%; padding: 0.7rem; border: 2px solid var(--border); border-radius: 8px; font-size: 1rem; outline: none; transition: 0.2s; }
input:focus { border-color: var(--mango); box-shadow: 0 0 0 3px var(--mango-glow); }

.global-params { padding: 1.5rem; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); margin-bottom: 2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.main-btn {
    width: 100%; padding: 1.2rem; background: var(--btn-bg); color: var(--btn-text); border: none; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.3s; font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.main-btn:hover { background: var(--mango); color: #0f172a; transform: translateY(-2px); box-shadow: 0 8px 25px var(--mango-glow); }

.result-section { margin-top: 3rem; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.summary-card { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; background: var(--bg); border: 2px solid var(--mango); padding: 2rem; border-radius: 20px; align-items: center; }
@media (max-width: 600px) { .summary-card { grid-template-columns: 1fr; } }

.aniseikonia-val { text-align: left; display: flex; flex-direction: column; gap: 1.5rem; }
.val-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--ink-light); text-transform: uppercase; margin-bottom: 0.2rem; }
.val-group span { display: block; font-size: 2.5rem; font-weight: 900; line-height: 1; color: var(--ink); }

.visual-comparison { display: flex; justify-content: center; align-items: center; height: 150px; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); }
.box-container { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: 2rem; }
.box { 
    width: 80px; height: 80px; background: var(--mango); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.interpretation { margin-top: 2rem; padding: 1.5rem; border-left: 6px solid var(--mango); background: var(--surface); border-radius: 0 12px 12px 0; border: 1px solid var(--border); border-left-width: 6px; }
.interpretation h4 { margin-bottom: 0.5rem; font-family: 'Georgia', serif; }

.math-dropdown { margin: 1.5rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.math-dropdown summary { padding: 0.8rem 1rem; font-weight: 600; cursor: pointer; color: var(--ink); list-style: none; background: rgba(246, 184, 75, 0.1); transition: background 0.2s; }
.math-dropdown summary:hover { background: rgba(246, 184, 75, 0.2); }
.math-content { padding: 1rem; font-size: 0.85rem; color: var(--ink-light); }
.math-content ul { padding-left: 1.2rem; }
.math-content li { margin-bottom: 0.5rem; }

.references { margin-top: 3rem; padding: 2rem; background: var(--surface-2); border-radius: 15px; font-size: 0.9rem; }
.references ol { padding-left: 1.2rem; margin-top: 0.5rem; }
.disclaimer { font-style: italic; color: #64748b; font-size: 0.8rem; margin-top: 1rem; border-top: 1px solid #e2e8f0; padding-top: 1rem; }
