/* calculadora-uf.cl — ported from the styled-components of the React version. */

:root {
    --blue: #4C56C0;
    --blue-light: #A3AAF6;
    --orange: #F1682C;
    --green-selected: #9ADDB1;
    --grey-bg: #e4e4e4;
    --grey-panel: #f9f9f9;
    --border: #dadada;
}

* { box-sizing: border-box; }

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 300;
    margin: 0;
    background-color: var(--grey-bg);
    color: #242424;
}

a { color: var(--blue); }
hr { border: 0; height: 1px; background-color: #c1c1c1; margin: 15px 0; }
h2 { color: #808080; }
button { font: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
.center { text-align: center; }
.strong { font-weight: bold; }

/* ---------- Layout ---------- */

.wrapper { margin: auto; max-width: 1090px; display: flex; justify-content: center; }
.skyscraper { width: 160px; padding: 85px 0 0; overflow: hidden; flex-shrink: 0; }
.container { width: 770px; background-color: #fff; }
.menu-top { min-height: 45px; padding: 4px 8px; background-color: var(--grey-panel); display: flex; align-items: center; }
.logo { width: 200px; height: 43px; display: block; }
.content { border: 1px solid #f0f0f0; padding: 15px; }

@media (min-width: 1370px) {
    .wrapper { max-width: 1370px; }
    .skyscraper { width: 300px; }
}
@media (max-width: 1090px) {
    .skyscraper { display: none; }
    .container { width: 100%; }
}

.footer { background-color: var(--grey-panel); font-size: 12px; color: #808080; padding: 30px; display: flex; gap: 20px; }
.footer-col { flex: 1 1 50%; }
.footer h2 { font-size: 16px; margin: 14px 0 4px; }
.link-items { margin: 0; padding: 0; list-style: none; }
.revision { font-size: 11px; color: #aaa; }
@media (max-width: 600px) { .footer { flex-direction: column; } }

.alert {
    margin: 0;
    padding: 0 0 0 10px;
    line-height: 30px;
    color: white;
    background-color: #659a3d;
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s;
}
.alert.active { max-height: 100px; }
@media (max-width: 450px) {
    .alert { position: fixed; bottom: 0; width: 100%; z-index: 100; line-height: 40px; }
}

/* ---------- Page parts ---------- */

.title { text-align: center; font-size: 24px; color: #242424; margin: 6px 0; }
.date-container { font-size: 14px; text-align: center; margin-bottom: 20px; }

.date-picker { margin: 6px 0 10px; }
.date-picker-label { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.date-picker-label strong { font-weight: 700; }
.date-picker-icon { width: 22px; height: 22px; }
/* The native input stays in the page (for the form and the picker popup) but invisible. */
.date-picker-input { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; }

.day-strip { display: flex; justify-content: center; align-items: center; gap: 8px; }
.day-strip ul { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.day {
    display: block;
    color: black;
    text-decoration: none;
    padding: 6px 5px;
    min-width: 30px;
    margin-right: 6px;
    border-radius: 10px;
    line-height: 1.3;
}
.day-month { display: block; font-size: 10px; color: grey; }
.day-selected { background: black; color: white; }
.day-selected .day-month { color: white; }
.day-disabled { color: #D1D1D1; }
.day-arrow img { height: 25px; display: block; }
@media (max-width: 780px) { .day-arrow { display: none; } }

.value-banner {
    font-size: 26px;
    margin: 0 0 20px;
    text-align: center;
    padding: 10px;
    background-color: var(--blue);
    color: var(--blue-light);
}
.value-number { color: white; font-weight: 400; transition: color .25s; }
.value-number.copying { color: #dc9a20; }
.value-banner .copy-link img { width: 16px; }

.copy-link { padding: 2px 10px; vertical-align: middle; }

/* ---------- Calculator ---------- */

.calculator { margin: 25px 0; background-color: #eceff1; box-shadow: 0 1px 4px 0 rgba(0,0,0,.37); padding: 2px 15px 5px; }
.calc-title { font-weight: 400; line-height: 38px; }
.calc-title img { width: 16px; vertical-align: middle; }
.calc-date { line-height: 30px; padding: 0 5px; }
.calc-date-past { background-color: var(--green-selected); }
@media (max-width: 650px) { .calc-date { display: none; } }
@media (max-width: 450px) { .calc-title { font-size: 15px; } .swap-inline { display: none; } }

.calc-row { display: flex; margin: 2px 0 8px; }
.calc-col { flex: 1; min-width: 0; }
.calc-header { border: 1px solid var(--border); border-bottom: none; padding: 6px 12px; background-color: #f4faff; line-height: 26px; }
.calc-input-box { border: 1px solid var(--border); background-color: #fff; display: flex; }
.calc-input-box.error { border: 2px solid red; }
.calc-input { padding: 0 6px 0 12px; line-height: 48px; height: 48px; font-size: 18px; border: 0; flex-grow: 1; width: 100%; font-family: inherit; }
.calc-save img { height: 22px; width: 22px; margin: 13px 10px 13px 0; display: block; }
.calc-swap { width: 45px; display: flex; align-items: center; justify-content: center; }
.calc-swap img { width: 28px; }
.calc-result {
    border: 1px solid var(--border);
    line-height: 48px;
    height: 50px;
    font-size: 18px;
    background-color: #fff;
    padding-left: 12px;
    display: flex;
    color: var(--orange);
    transition: color .25s;
}
.calc-result.copying { color: #B3816B; border-bottom-color: #000; }
.calc-result-value { flex-grow: 1; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.calc-result .copy-link img { width: 14px; }
.calc-disclaimer { background-color: white; padding: 10px; margin: 5px 0; text-align: center; }
.calc-unavailable { background: white; padding: 15px; text-align: center; }
@media (max-width: 450px) { .calc-input { padding-left: 6px; } }

.favorites { margin: 8px 0; }
.favorites table { width: 100%; border-collapse: collapse; }
.favorites th { background: white; font-weight: bold; padding: 10px 5px; }
.favorites td { border-bottom: 1px solid #D1D1D1; padding: 5px; line-height: 19px; }
.favorites .fav-delete img { width: 12px; }
.favorites-hint { text-align: center; margin: 8px; font-size: 11px; }

.ad-container { margin: 10px auto; text-align: center; min-height: 94px; }
.ad-under-calculator { width: 320px; height: 250px; }
@media (min-width: 500px) { .ad-under-calculator { width: 468px; height: 60px; } }
@media (min-width: 768px) { .ad-under-calculator { width: 728px; height: 90px; } }

/* ---------- Month tables ---------- */

.months { display: flex; gap: 0; }
.month-table { flex: 1 0 50%; width: 50%; }
.months-single .month-table { flex-basis: 100%; width: 100%; }
@media (max-width: 768px) {
    .months:not(.months-single) { display: none; }
    .month-table { width: 100%; }
}
.month-table table { width: 100%; border-collapse: collapse; border: 1px solid #97bdca; }
.month-table th { background-color: var(--grey-panel); padding: 8px; }
.month-table td { padding: 8px; border-bottom: 1px solid rgba(108,146,159,.18); }
.month-table tr.selected { background-color: var(--green-selected); }
.month-title { display: flex; align-items: center; color: #525252; font-size: 14px; }
.month-title span { flex-grow: 1; line-height: 25px; }
.month-arrow { background-color: #f1f1f1; height: 25px; width: 25px; display: block; }
.month-arrow img { display: block; }
.col-date { width: 190px; }
.col-icon { width: 40px; }
.month-notice { text-align: center; line-height: 20px; padding: 10px; color: gray; }

.month-nav a { font-weight: normal; }
.month-nav a.strong { font-weight: bold; }

.text-box { border: 1px solid #f0f0f0; margin: 25px 0 15px; padding: 10px; }
.text-box h2 { color: #383838; font-size: 16px; margin: 10px 0; }

/* ---------- User menu (Google sign-in) ---------- */

.user-menu { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.user-menu .avatar { border-radius: 50%; width: 30px; height: 30px; }
.user-menu .user-name { display: none; }
@media (min-width: 768px) { .user-menu .user-name { display: inline; } }
.inline-form { display: inline; margin: 0; }
.link-button { color: var(--blue); text-decoration: underline; font-size: 13px; }
.fav-actions { width: 5%; text-align: center; }

/* ---------- Legal pages ---------- */

.legal { max-width: 680px; margin: 0 auto; font-size: 14px; line-height: 1.6; }
.legal h2 { font-size: 16px; color: #383838; margin: 22px 0 6px; }
.legal-updated { text-align: center; color: #808080; font-size: 12px; }
