@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  font-family: "DM Sans", sans-serif;
  color: #1b2927;
  background: #f5f7f5;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(26rem, 1.08fr) minmax(28rem, .92fr); }
.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 4.25rem);
  color: #f5fbf8;
  background: #123f38;
}
.brand-panel::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 82% 18%, rgba(101, 207, 160, .18), transparent 30%), radial-gradient(circle at 0 100%, rgba(232, 185, 99, .14), transparent 34%);
  content: "";
}
.brand-panel::after {
  position: absolute;
  z-index: -1;
  top: 7%; right: -16rem;
  width: 34rem; height: 34rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(255,255,255,.025), 0 0 0 10rem rgba(255,255,255,.018);
  content: "";
}
.brand { display: inline-flex; align-items: center; gap: .85rem; color: inherit; font-family: Manrope, sans-serif; font-size: 1.05rem; font-weight: 800; letter-spacing: .12em; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: end; gap: 3px; width: 2.2rem; height: 2.2rem; padding: .48rem; border-radius: .65rem; color: #123f38; background: #e7b85f; }
.brand-mark span { flex: 1; border-radius: 2px; background: currentColor; }
.brand-mark span:nth-child(1) { height: 55%; }
.brand-mark span:nth-child(2) { height: 100%; }
.brand-mark span:nth-child(3) { height: 75%; }
.brand-copy { max-width: 40rem; margin: auto 0 2.5rem; }
.eyebrow { margin: 0 0 .75rem; color: #c48a29; font-size: .75rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.brand-copy .eyebrow { color: #e7b85f; }
.brand-copy h1 { max-width: 36rem; margin: 0; font: 800 clamp(2.5rem, 4.7vw, 4.75rem)/1.05 Manrope, sans-serif; letter-spacing: -.055em; }
.brand-copy > p:last-child { max-width: 32rem; margin: 1.6rem 0 0; color: #c5d9d4; font-size: 1.1rem; line-height: 1.7; }
.week-preview { max-width: 39rem; padding: 1.25rem; border: 1px solid rgba(255,255,255,.1); border-radius: 1.25rem; background: rgba(255,255,255,.055); box-shadow: 0 1.5rem 4rem rgba(0,0,0,.16); backdrop-filter: blur(12px); }
.preview-head { display: flex; justify-content: space-between; color: #bdd2cc; font-size: .75rem; }
.preview-grid { position: relative; height: 7.5rem; margin-top: 1rem; border-top: 1px solid rgba(255,255,255,.08); background: repeating-linear-gradient(to right, transparent 0, transparent calc(20% - 1px), rgba(255,255,255,.07) calc(20% - 1px), rgba(255,255,255,.07) 20%), repeating-linear-gradient(to bottom, transparent 0, transparent calc(33.333% - 1px), rgba(255,255,255,.07) calc(33.333% - 1px), rgba(255,255,255,.07) 33.333%); }
.lesson { position: absolute; height: 1.65rem; border-radius: .4rem; background: #e7b85f; opacity: .85; }
.lesson-a { top: .65rem; left: 2%; width: 17%; }
.lesson-b { top: 3.15rem; left: 23%; width: 35%; background: #68bd99; }
.lesson-c { top: 5.65rem; left: 62%; width: 17%; }
.lesson-d { top: .65rem; left: 82%; width: 16%; background: #68bd99; }
.brand-footer { margin: 2.2rem 0 0; color: #8eb0a7; font-size: .78rem; }

.form-panel { display: grid; place-items: center; padding: clamp(2rem, 6vw, 6rem); background: #fbfcfb; }
.login-card { width: min(100%, 28rem); }
.mobile-brand { display: none; }
.login-card h2 { margin: 0; color: #172724; font: 800 clamp(2rem, 4vw, 2.65rem)/1.12 Manrope, sans-serif; letter-spacing: -.04em; }
.form-intro { margin: 1rem 0 2rem; color: #667572; line-height: 1.6; }
.login-form { display: grid; gap: .7rem; }
.login-form label { margin-top: .55rem; color: #34433f; font-size: .86rem; font-weight: 700; }
.login-form input { width: 100%; height: 3.45rem; padding: 0 1rem; border: 1px solid #d6dedb; border-radius: .75rem; outline: 0; color: #1b2927; background: white; transition: border-color .2s, box-shadow .2s; }
.login-form input::placeholder { color: #99a5a2; }
.login-form input:focus { border-color: #236e5e; box-shadow: 0 0 0 4px rgba(35,110,94,.11); }
.password-field { position: relative; }
.password-field input { padding-right: 3.5rem; }
.password-toggle { position: absolute; top: 50%; right: .5rem; width: 2.5rem; height: 2.5rem; border: 0; border-radius: .55rem; color: #75827f; background: transparent; transform: translateY(-50%); cursor: pointer; }
.password-toggle:hover { color: #236e5e; background: #edf4f1; }
.primary-button { display: flex; align-items: center; justify-content: space-between; height: 3.55rem; margin-top: 1rem; padding: 0 1.25rem; border: 0; border-radius: .8rem; color: white; background: #1c6757; box-shadow: 0 .75rem 1.6rem rgba(28,103,87,.22); font-weight: 700; cursor: pointer; transition: transform .2s, background .2s; }
.primary-button:hover { background: #155446; transform: translateY(-1px); }
.help-text { margin: 1.75rem 0 0; color: #84908d; font-size: .82rem; line-height: 1.5; text-align: center; }
.alert { margin: 0 0 1.25rem; padding: .85rem 1rem; border-radius: .7rem; font-size: .88rem; }
.alert-error { border: 1px solid #efc4be; color: #8d3025; background: #fff0ed; }

.dashboard-body { min-height: 100vh; background: #f5f7f5; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1.25rem, 5vw, 4rem); border-bottom: 1px solid #dfe6e3; background: white; }
.brand-dark { color: #153e36; }
.ghost-button { padding: .7rem 1rem; border: 1px solid #cad6d2; border-radius: .65rem; color: #285047; background: white; cursor: pointer; }
.dashboard { width: min(70rem, calc(100% - 2.5rem)); margin: 5rem auto; }
.dashboard > h1 { margin: 0; font: 800 clamp(2.3rem, 5vw, 4rem)/1.1 Manrope, sans-serif; letter-spacing: -.05em; }
.dashboard > p:not(.eyebrow) { color: #667572; font-size: 1.08rem; }
.empty-state { margin-top: 3rem; padding: 4rem 2rem; border: 1px dashed #bccdc8; border-radius: 1.2rem; background: white; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin: 0 auto 1rem; border-radius: .8rem; color: #1c6757; background: #e3f1ec; font-size: 1.5rem; }
.empty-state h2 { margin: 0; font-family: Manrope, sans-serif; }
.empty-state p { color: #74827f; }

/* Aplicación privada */
.app-body { min-height: 100vh; padding-left: 16.5rem; background: #f4f6f4; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 16.5rem; padding: 1.6rem 1.25rem; color: #ecf5f1; background: #123f38; }
.sidebar .brand { padding: 0 .55rem; }
.app-nav { display: grid; gap: .3rem; margin-top: 3.5rem; }
.app-nav a { display: flex; align-items: center; gap: .8rem; padding: .78rem .85rem; border-radius: .65rem; color: #b9cec8; font-size: .9rem; font-weight: 600; text-decoration: none; }
.app-nav a:hover, .app-nav a.active { color: white; background: rgba(255,255,255,.1); }
.app-nav a span { width: 1.2rem; color: #e7b85f; text-align: center; }
.app-nav a.disabled { opacity: .48; pointer-events: none; }
.nav-label { margin: 1.6rem .85rem .4rem; color: #6f958b; font-size: .67rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-logout { margin-top: auto; }
.sidebar-logout button { width: 100%; padding: .75rem; border: 1px solid rgba(255,255,255,.14); border-radius: .65rem; color: #c7d9d4; background: transparent; cursor: pointer; }
.app-main { width: min(76rem, calc(100% - 4rem)); margin: 0 auto; padding: 3rem 0 5rem; }
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3rem; }
.app-header h1 { margin: 0; font: 800 clamp(2rem, 4vw, 3.25rem)/1.1 Manrope, sans-serif; letter-spacing: -.045em; }
.user-chip { display: flex; align-items: center; gap: .75rem; }
.user-chip > span { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; border-radius: .75rem; color: #155446; background: #dcebe6; font-weight: 800; }
.user-chip div { display: grid; }
.user-chip small { color: #7d8a87; }
.alert-success { border: 1px solid #b8ddcd; color: #216343; background: #eaf7f1; }
.school-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1.5rem; }
.school-heading h2 { margin: 0; font: 750 clamp(1.5rem, 3vw, 2.15rem) Manrope, sans-serif; letter-spacing: -.035em; }
.role-pill { padding: .42rem .7rem; border-radius: 999px; color: #22604f; background: #dfede8; font-size: .72rem; font-weight: 700; text-transform: capitalize; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.metric-card { display: grid; gap: .55rem; padding: 1.5rem; border: 1px solid #e0e6e3; border-radius: 1rem; background: white; }
.metric-card > span { color: #788682; font-size: .78rem; font-weight: 650; }
.metric-card strong { font: 750 1.45rem Manrope, sans-serif; }
.metric-card small { color: #8b9693; }
.metric-card.muted { background: #eaf1ee; }
.next-step-card, .onboarding-card { margin-top: 1.25rem; border: 1px solid #dfe6e3; border-radius: 1.2rem; background: white; box-shadow: 0 1rem 3rem rgba(24,59,51,.05); }
.next-step-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem; padding: 2rem; }
.next-step-card h2 { margin: 0; font-family: Manrope, sans-serif; }
.next-step-card p:last-child { margin-bottom: 0; color: #71807c; }
.step-number { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: .85rem; color: #19604f; background: #e0f0ea; font-weight: 800; }
.secondary-button { padding: .75rem 1rem; border: 1px solid #cbd7d3; border-radius: .65rem; color: #7b8885; background: #f7f9f8; }
.onboarding-card { display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; }
.onboarding-copy { padding: clamp(2rem, 5vw, 4rem); background: radial-gradient(circle at 10% 100%, rgba(231,184,95,.13), transparent 35%); }
.progress-label { display: inline-block; padding: .38rem .65rem; border-radius: 999px; color: #805514; background: #fff0cf; font-size: .72rem; font-weight: 700; }
.onboarding-copy h2 { max-width: 28rem; margin: 1.25rem 0 .75rem; font: 800 clamp(2rem, 4vw, 3.25rem)/1.08 Manrope, sans-serif; letter-spacing: -.05em; }
.onboarding-copy p { max-width: 32rem; color: #697773; font-size: 1.05rem; line-height: 1.65; }
.primary-link { display: inline-flex; align-items: center; gap: 1.5rem; margin-top: 1.25rem; padding: .9rem 1.15rem; border-radius: .75rem; color: white; background: #1c6757; font-weight: 700; text-decoration: none; box-shadow: 0 .8rem 1.8rem rgba(28,103,87,.2); }
.setup-list { display: grid; align-content: center; gap: .5rem; padding: 2rem; background: #f0f4f2; }
.setup-list > div { display: flex; align-items: center; gap: .9rem; padding: .9rem; border-radius: .75rem; color: #7f8b88; }
.setup-list > div.current { color: #1c4f43; background: white; box-shadow: 0 .5rem 1.5rem rgba(20,60,51,.07); }
.setup-list span, .setup-progress li > span { display: grid; flex: 0 0 auto; place-items: center; width: 2rem; height: 2rem; border: 1px solid #ccd8d4; border-radius: 50%; font-size: .75rem; font-weight: 800; }
.setup-list .current span { border-color: #1c6757; color: white; background: #1c6757; }
.setup-list div div, .setup-progress li div { display: grid; }
.setup-list small, .setup-progress small { margin-top: .18rem; color: #919b98; }

/* Asistente de configuración */
.setup-body { min-height: 100vh; background: #f6f8f6; }
.setup-topbar { display: flex; align-items: center; justify-content: space-between; height: 5.2rem; padding: 0 clamp(1.25rem, 4vw, 3.5rem); border-bottom: 1px solid #dfe5e2; background: white; }
.ghost-link { color: #55706a; font-size: .86rem; font-weight: 650; text-decoration: none; }
.setup-shell { display: grid; grid-template-columns: 19rem minmax(0, 48rem); justify-content: center; gap: clamp(2rem, 6vw, 6rem); padding: clamp(2.5rem, 6vw, 5rem) 2rem; }
.setup-progress h1 { margin: 0 0 2.5rem; font: 750 1.55rem/1.3 Manrope, sans-serif; letter-spacing: -.035em; }
.setup-progress ol { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.setup-progress li { display: flex; align-items: center; gap: .85rem; padding: .85rem; color: #87928f; }
.setup-progress li.active { border-radius: .8rem; color: #174b40; background: #e7f0ed; }
.setup-progress li.active > span { border-color: #1c6757; color: white; background: #1c6757; }
.setup-content { min-width: 0; }
.form-heading h2 { margin: 0; font: 800 clamp(2rem, 4vw, 3.1rem)/1.1 Manrope, sans-serif; letter-spacing: -.05em; }
.form-heading > p:last-child { margin-bottom: 2rem; color: #71807c; font-size: 1.05rem; }
.setup-form { display: grid; gap: 1rem; }
.setup-form fieldset { margin: 0; padding: 1.6rem; border: 1px solid #dfe6e3; border-radius: 1rem; background: white; }
.setup-form legend { padding: 0 .35rem; font: 750 1.05rem Manrope, sans-serif; }
.fieldset-help { margin: 0 0 1.25rem; color: #7a8783; font-size: .86rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field { display: grid; gap: .5rem; color: #40504c; font-size: .82rem; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.field input { width: 100%; height: 3.1rem; padding: 0 .9rem; border: 1px solid #d2dcd8; border-radius: .65rem; outline: 0; color: #1d2d29; background: #fcfdfc; }
.field input:focus { border-color: #287462; box-shadow: 0 0 0 3px rgba(40,116,98,.1); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 3.5rem; }
.input-suffix span { position: absolute; top: 50%; right: 1rem; color: #85918e; transform: translateY(-50%); }
.weekday-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .55rem; }
.day-check { cursor: pointer; }
.day-check input { position: absolute; opacity: 0; pointer-events: none; }
.day-check span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #d3ddd9; border-radius: .65rem; color: #60706c; background: #fbfcfb; font-weight: 800; text-transform: uppercase; }
.day-check small { display: none; }
.day-check input:checked + span { border-color: #1c6757; color: white; background: #1c6757; box-shadow: 0 .4rem 1rem rgba(28,103,87,.16); }
.time-grid { margin-top: 1.4rem; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1.5rem; padding-top: .5rem; }
.setup-submit { width: auto; min-width: 14rem; margin: 0; }

@media (max-width: 950px) {
  .app-body { padding-left: 0; padding-bottom: 4.5rem; }
  .sidebar { z-index: 10; inset: auto 0 0; flex-direction: row; width: auto; height: 4.5rem; padding: .5rem; }
  .sidebar > .brand, .sidebar .nav-label, .sidebar-logout { display: none; }
  .app-nav { grid-template-columns: repeat(3, 1fr); width: 100%; margin: 0; }
  .app-nav a { justify-content: center; padding: .5rem; font-size: .72rem; }
  .app-nav a:nth-of-type(n+4) { display: none; }
  .app-main { width: min(100% - 2rem, 76rem); padding-top: 1.5rem; }
  .metrics-grid { grid-template-columns: 1fr; }
  .onboarding-card { grid-template-columns: 1fr; }
  .setup-shell { grid-template-columns: 1fr; }
  .setup-progress ol { grid-template-columns: repeat(4, 1fr); }
  .setup-progress li { justify-content: center; }
  .setup-progress li div { display: none; }
}

@media (max-width: 600px) {
  .app-header { align-items: start; }
  .user-chip div { display: none; }
  .next-step-card { grid-template-columns: auto 1fr; }
  .next-step-card button { display: none; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .weekday-grid { grid-template-columns: repeat(5, 1fr); }
  .setup-shell { padding: 2rem 1rem; }
  .setup-form fieldset { padding: 1.1rem; }
}

@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 2rem 1.25rem; }
  .mobile-brand { display: block; margin-bottom: 3rem; color: #1c6757; font: 800 1.05rem Manrope, sans-serif; letter-spacing: .14em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
