@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap');

.space-grotesk {
  font-family: "Space Grotesk", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
}

html {
    font-family: 'Century Gothic', 'Calibri', sans-serif;
    display: block;
    width: 100vw;
    height: 100vh;
}

.body-light {
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--light-primary-background-color);
    color: var(--light-primary-font-color);
}

.header-light {
    background-color: var(--light-secondary-background-color);
    color: var(--light-secondary-font-color);
}

.nav-link {
    position: relative;
    text-decoration: none;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--light-secondary-font-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card {
    margin: 2rem 0;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: var(--light-secondary-background-color);
    color: var(--light-secondary-font-color);
}

.nav-link:hover::after{
    width: 100%;
}

.user-header .nav-link::after {
    display: none;
}

.nav-link {
    position: relative;
    text-decoration: none;
}

.routine-field.selected::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--light-secondary-font-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card h1 {
    font-size: 2rem;
    font-weight: bold;
}

.form input:not([type="checkbox"]):not([type="radio"]):not(.submit) {
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
    border-width: 0;
    padding: 0.5rem;
    border-radius: 1rem;
    height: 3rem;
    width: 20rem;
    text-align: center;
}

.form select {
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
    border-width: 0;
    padding: 0.5rem;
    border-radius: 1rem;
    height: 3rem;
    width: 20rem;
    text-align: center;
}

#error_explanation {
    color: var(--danger-color);
}

.form input.submit {
    border: 2px solid var(--highlight-color);
    color: var(--light-secondary-font-color);
    background-color: var(--light-secondary-background-color);
    padding: 0.5rem;
    border-radius: 1rem;
    height: 3rem;
    width: 20rem;
    text-align: center;
}

.unrestrained-form input:not([type="checkbox"]):not([type="radio"]):not(.submit) {
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
    border-width: 0;
    padding: 0.5rem;
    border-radius: 1rem;
    text-align: center;
}

.unrestrained-form select {
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
    border-width: 0;
    padding: 0.5rem;
    border-radius: 1rem;
    text-align: center;
}

.unrestrained-form input.submit {
    border: 2px solid var(--highlight-color);
    color: var(--light-secondary-font-color);
    background-color: var(--light-secondary-background-color);
    padding: 0.5rem;
    border-radius: 1rem;
    text-align: center;
}

.submit {
    border: 2px solid var(--highlight-color);
    color: var(--light-secondary-font-color);
    background-color: var(--light-secondary-background-color);
}

.unrestrained-form input.submit:hover, .form input.submit:hover, .submit:hover  {
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--light-secondary-background-color);
    color: var(--light-secondary-font-color);
    border-radius: 1rem;
}

.section table th, .section table td {
    padding: 1rem;
    text-align: left;
}

.section table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-highlight {
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
}

a.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    background-color: var(--highlight-color);
    color: var(--light-primary-font-color);
    text-decoration: none;
}

a.btn-danger {
    background-color: var(--danger-color);
    color: var(--light-secondary-font-color);
}

a.btn-notice {
    background-color: var(--notice-color);
    color: var(--light-secondary-font-color);
}

a.btn-success {
    background-color: var(--success-color);
    color: var(--light-secondary-font-color);
}

.modal-background {
    background-color: rgba(0,0,0,0.3);
}

.text-highlight {
    color: var(--highlight-color);
}

.button-highlight {
    color: var(--highlight-color);
    border: 2px var(--highlight-color) solid;
    border-radius: 1rem;
}

.button-highlight:hover {
    color: var(--light-primary-font-color);
    background-color: var(--highlight-color);
}

.button-danger {
    color: white;
    border: 2px var(--danger-color) solid;
    border-radius: 1rem;
}

.button-danger:hover {
    color: white;
    background-color: var(--danger-color);
}

.button-notice {
    color: white;
    border: 2px var(--notice-color) solid;
    border-radius: 1rem;
}

.button-notice:hover {
    color: white;
    background-color: var(--notice-color);
}

#product_modal {
    z-index: 100;
}

/* Plain (unlayered) rules on purpose: Tailwind v4 wraps its utilities in
   @layer utilities, and unlayered styles always win over layered ones
   regardless of source order or specificity, so bg-*/text-* utility
   classes can never override .card/.section/.body-light here. */
.section.error-page,
.card.error-page,
.body-light.error-page {
    background-color: var(--color-blue-950);
    color: var(--color-green-300);
}

.error-page .error-code {
    font-size: 8rem;
    font-weight: bold;
    line-height: 1;
}
/* Product modal: status line, Manual / Rutina tabs, power sliders, routine order */
.state-pill {
    border: 2px solid var(--highlight-color);
    color: var(--highlight-color);
    border-radius: 1rem;
    padding: 0.25rem 0.9rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.state-pill.is-off { border-color: var(--danger-color); color: var(--light-secondary-font-color); }
.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.08);
}
.mode-chip::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background-color: currentColor; }
.mode-chip.is-manual { color: var(--highlight-color); }
.mode-chip.is-routine { color: #57c454; }
.tab-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.06);
}
.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    border-radius: 0.8rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}
.tab:hover { color: var(--light-secondary-font-color); background-color: rgba(255, 255, 255, 0.06); }
.tab[aria-selected="true"] { background-color: var(--highlight-color); color: var(--light-primary-font-color); }
.tab-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background-color: #57c454; }
.tab-dot[hidden], .tab-panel[hidden] { display: none; }
.tab:focus-visible, .routine-swap:focus-visible { outline: 2px dashed var(--highlight-color); outline-offset: 3px; }
.power-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.06);
}
.power-box-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.power-box-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.power-box-value { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 2.25rem; font-variant-numeric: tabular-nums; }
.power-range { flex-basis: 100%; width: 100%; accent-color: var(--highlight-color); }
.power-range:disabled { opacity: 0.4; }
/* The routine power form isn't an .unrestrained-form, so its "Actualizar" button doesn't get that rounding. */
.power-box .submit { border-radius: 1rem; }
.override-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border: 1px dashed var(--highlight-color);
    border-radius: 1rem;
    font-size: 0.875rem;
}
.routine-summary { padding: 0.75rem 1rem; border-radius: 1rem; background-color: rgba(255, 255, 255, 0.06); }
.routine-order { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 0.75rem; }
.routine-step { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--highlight-color); }
.routine-swap {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 2px solid var(--highlight-color);
    border-radius: 50%;
    color: var(--highlight-color);
}
.routine-swap:hover { background-color: var(--highlight-color); color: var(--light-primary-font-color); }
.routine-swap svg { transition: transform 0.3s; }
.routine-swap.is-turned svg { transform: rotate(180deg); }
.unrestrained-form input:user-invalid { outline: 3px solid var(--danger-color); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .routine-swap svg { transition: none; } }
