/* 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-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(76,86,192,.15); }
.calc-input:focus { outline: none; }
.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; }
.share-button {
    display: flex; align-items: center; gap: 6px; margin: 6px 0 0 auto;
    font-size: 12px; color: var(--blue); padding: 2px 4px;
}
.share-button:hover { text-decoration: underline; }
.share-button img { width: 14px; height: 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; } }

/* ---------- Favourites ---------- */

.favorites { margin: 10px 0 8px; }
.favorites-head {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0 4px 6px; font-size: 12px; color: #6b7280;
}
.favorites-title { font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .04em; }
.favorites-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.favorite { position: relative; display: flex; align-items: center; border-top: 1px solid #eef0f3; }
.favorite:first-child { border-top: 0; }
.favorite-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.favorite-desc {
    border: 0; background: transparent; font: inherit; font-size: 12px; color: #4b5563;
    padding: 8px 48% 0 12px; width: 100%; min-width: 0; border-radius: 4px 4px 0 0;
}
.favorite-desc::placeholder { color: #c3c8d2; font-style: italic; }
.favorite-desc:focus { outline: none; background: #fff; color: #242424; box-shadow: inset 0 -1px 0 #c9cdf5; }
.favorite-use {
    flex: 1; min-width: 0; display: block;
    padding: 4px 48% 10px 12px; text-align: left; font-size: 14px; color: #242424;
    font-variant-numeric: tabular-nums; transition: background .15s;
}
.favorite { transition: background .15s; }
.favorite:hover, .favorite:focus-within { background: #f4f6ff; }
.favorite-use:focus-visible { outline: none; }
.favorite-from { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The converted value is centred vertically across the whole row (description + amount). */
.favorite-to {
    position: absolute; right: 52px; top: 50%; transform: translateY(-50%); max-width: 45%;
    text-align: right; color: var(--orange); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.favorite-delete {
    width: 40px; align-self: stretch; font-size: 20px; line-height: 1; color: #b0b6c3;
    transition: color .15s, background .15s;
}
.favorite-delete:hover, .favorite-delete:focus-visible { color: #d93025; background: #fdf0ef; outline: none; }
.favorites-private { margin: 6px 4px 0; font-size: 11px; color: #6b7280; text-align: center; }
.favorites-hint { text-align: center; margin: 8px; font-size: 12px; color: #4b5563; }
.inline-icon { height: 14px; vertical-align: -2px; }

/* ---------- Login tip (shown once to signed-out visitors) ---------- */

/* Takes no space until opened, then slides down (grid rows 0fr -> 1fr). */
.login-tip { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s ease; }
.login-tip.open { grid-template-rows: 1fr; }
.login-tip-inner { overflow: hidden; min-height: 0; }
.login-tip-box {
    position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 4px 0 6px; padding: 12px 40px 12px 16px;
    background: var(--blue); color: #fff; border-radius: 6px;
}
.login-tip-text { flex: 1 1 260px; margin: 0; font-size: 14px; line-height: 1.6; color: #d4d8ff; }
.login-tip-text strong {
    font-weight: 800; color: #2a318f; white-space: nowrap;
    background: #d4d8ff; padding: 1px 7px; border-radius: 4px;
}
/* The "Ingresar con Google" button, in the tip and in the signed-out hint. */
.google-button {
    display: inline-block; background: #fff; color: var(--blue); text-decoration: none; font-weight: 700;
    padding: 8px 14px; border: 1px solid var(--blue); border-radius: 4px; white-space: nowrap;
}
.google-button:hover { background: #e8eaff; }
.login-tip .google-button { border-color: #fff; }
.save-offer { display: flex; justify-content: center; padding: 6px 0 4px; }
.save-button { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.save-button img { width: 18px; height: 18px; }
.favorites-login { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.login-tip-close {
    position: absolute; top: 4px; right: 6px; width: 28px; height: 28px;
    font-size: 20px; line-height: 1; color: var(--blue-light); border-radius: 50%;
}
.login-tip-close:hover, .login-tip-close:focus-visible { background: rgba(255,255,255,.15); color: #fff; outline: none; }
.login-tip.open ~ .favorites-hint { display: none !important; }
@media (prefers-reduced-motion: reduce) { .login-tip { transition: none; } }

.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; }
.text-box h3 { color: #383838; font-size: 14px; margin: 16px 0 4px; }
.seo-text p { line-height: 1.6; }

/* ---------- 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; }

/* ---------- Amount conversion pages ---------- */

.conversion-result { text-align: center; margin: 4px 0 18px; }
.conversion-equation { font-size: 26px; margin: 6px 0 2px; color: #242424; }
.conversion-value { color: var(--orange); }
.conversion-date { margin: 0; color: #6b7280; font-size: 13px; }
.conversion-table td { font-variant-numeric: tabular-nums; }
.conversion-links { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.conversion-links a { white-space: nowrap; }

/* ---------- API docs ---------- */

.api-docs pre { background: #1f2337; color: #e6e8ff; padding: 10px 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; }
.api-docs code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-docs p code { background: #eef0f6; padding: 1px 5px; border-radius: 3px; }
