/*
  ProfeSuite AI auth flow — aula contemporánea.
  Shared visual system for login, register and password recovery.
*/
:root {
  --auth-ink: #152037;
  --auth-muted: #637084;
  --auth-soft: #f8f2e5;
  --auth-paper: #fffdf8;
  --auth-paper-line: rgba(72, 144, 180, .08);
  --auth-board: #0d3236;
  --auth-board-deep: #071f27;
  --auth-board-line: rgba(235, 247, 239, .13);
  --auth-purple: #6d4aff;
  --auth-purple-2: #8b5cf6;
  --auth-cyan: #17c3e6;
  --auth-yellow: #f3c746;
  --auth-pink: #ef8797;
  --auth-green: #29c692;
  --auth-white: #ffffff;
  --auth-border: rgba(55, 66, 89, .16);
  --auth-shadow: 0 28px 70px rgba(56, 45, 26, .16);
  --auth-focus: rgba(109, 74, 255, .36);
  --auth-danger-bg: rgba(220, 38, 38, .1);
  --auth-danger-bd: rgba(220, 38, 38, .28);
  --auth-danger-tx: #991b1b;
  --auth-ok-bg: rgba(34, 197, 94, .13);
  --auth-ok-bd: rgba(34, 197, 94, .34);
  --auth-ok-tx: #166534;
}

[data-theme="dark"] {
  --auth-ink: #edf7f3;
  --auth-muted: #b8c7c4;
  --auth-soft: #071f27;
  --auth-paper: rgba(10, 34, 40, .9);
  --auth-paper-line: rgba(220, 245, 239, .06);
  --auth-board: #082b31;
  --auth-board-deep: #051820;
  --auth-board-line: rgba(236, 248, 239, .1);
  --auth-border: rgba(229, 245, 232, .16);
  --auth-shadow: 0 32px 80px rgba(0, 0, 0, .42);
  --auth-danger-bg: rgba(239, 68, 68, .15);
  --auth-danger-bd: rgba(248, 113, 113, .38);
  --auth-danger-tx: #fecaca;
  --auth-ok-bg: rgba(34, 197, 94, .16);
  --auth-ok-bd: rgba(74, 222, 128, .34);
  --auth-ok-tx: #bbf7d0;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background-color: var(--auth-soft);
  background-image:
    linear-gradient(90deg, transparent 0 7.5%, rgba(225, 115, 117, .1) 7.5% 7.65%, transparent 7.65%),
    repeating-linear-gradient(0deg, transparent 0 31px, var(--auth-paper-line) 31px 32px),
    linear-gradient(180deg, #fffdf8, #f4ead8);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 12% 12%, rgba(109, 74, 255, .14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(23, 195, 230, .12), transparent 32%),
    linear-gradient(145deg, var(--auth-board-deep), var(--auth-board));
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible {
  outline: 3px solid var(--auth-focus);
  outline-offset: 3px;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  padding: 22px;
  overflow: hidden;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(109, 74, 255, .1), transparent 27%),
    radial-gradient(circle at 88% 7%, rgba(23, 195, 230, .14), transparent 26%);
}

.auth-layout {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: calc(100vh - 44px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(360px, 1fr);
  overflow: hidden;
  border: 1px solid var(--auth-border);
  border-radius: 28px;
  background: rgba(255, 253, 248, .72);
  box-shadow: var(--auth-shadow);
}

[data-theme="dark"] .auth-layout {
  background: rgba(4, 20, 26, .72);
}

.visual-panel {
  position: relative;
  min-height: 660px;
  padding: 34px;
  color: #edf7f3;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 34%, rgba(40, 146, 156, .2), transparent 31%),
    radial-gradient(circle at 12% 7%, rgba(122, 83, 246, .17), transparent 30%),
    linear-gradient(145deg, var(--auth-board-deep), var(--auth-board) 65%, #092830);
}

.visual-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.45) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.3) 0 1px, transparent 1.5px),
    linear-gradient(105deg, transparent 48%, rgba(255,255,255,.05) 50%, transparent 52%);
  background-size: 38px 38px, 53px 53px, 190px 190px;
}

.brand-row,
.panel-copy,
.chalk-card,
.tool-strip,
.panel-footer {
  position: relative;
  z-index: 2;
}

.brand-row,
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  font-size: 19px;
  font-weight: 750;
  white-space: nowrap;
}

.brand b { color: #a994ff; font-weight: 800; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(243,199,70,.22), rgba(25,195,230,.12));
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}

.brand-mark svg {
  width: 31px;
  fill: none;
  stroke: #f7d86c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-mark .spark {
  fill: #62d7e7;
  stroke: none;
}

.home-link,
.theme-toggle,
.auth-link-button,
.password-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-ink);
  background: rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 760;
  transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}

.home-link,
.theme-toggle,
.auth-link-button {
  padding: 10px 15px;
}

.visual-panel .home-link {
  color: #edf7f3;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
}

.home-link:hover,
.theme-toggle:hover,
.auth-link-button:hover,
.password-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 74, 255, .36);
  box-shadow: 0 10px 22px rgba(45, 37, 21, .08);
}

.panel-copy {
  max-width: 470px;
  margin-top: 96px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 7px 12px;
  color: #f7d979;
  border: 1px solid rgba(247,217,121,.24);
  border-radius: 999px;
  background: rgba(247,217,121,.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3bd0eb;
  box-shadow: 0 0 0 5px rgba(59,208,235,.1);
}

.panel-copy h1 {
  margin: 0;
  font-size: clamp(39px, 4.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.panel-copy h1 span {
  color: transparent;
  background: linear-gradient(100deg, #a994ff, #6bdbea 70%, #f2d56c);
  background-clip: text;
  -webkit-background-clip: text;
}

.panel-copy p {
  margin: 22px 0 0;
  color: #bdc9c7;
  font-size: 17px;
}

.benefit-list {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbe7e2;
  font-size: 14px;
  font-weight: 680;
}

.benefit-list li::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--auth-yellow);
  box-shadow: 0 0 0 5px rgba(243, 199, 70, .12);
}

.chalk-card {
  width: min(390px, 92%);
  margin-top: 54px;
  padding: 22px;
  border: 1px solid rgba(237,245,232,.14);
  border-radius: 18px;
  background: rgba(248,250,240,.055);
  box-shadow: inset 0 0 28px rgba(0,0,0,.2);
}

.chalk-card strong {
  display: block;
  margin-bottom: 15px;
  color: #fff7cf;
  font-size: 14px;
}

.chalk-line {
  display: block;
  height: 7px;
  margin: 10px 0;
  border-radius: 999px;
  background: rgba(236, 248, 239, .18);
}

.chalk-line.short { width: 58%; }
.chalk-line.medium { width: 76%; }

.tool-strip {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 30px;
  height: 12px;
  border-radius: 10px 10px 2px 2px;
  background: linear-gradient(90deg, #eee6d7 0 28%, #f4c94c 28% 63%, #ef94a3 63% 82%, #b6dfef 82%);
  box-shadow: 0 -2px 4px rgba(0,0,0,.22);
}

.decor-pencil,
.decor-ruler,
.decor-eraser,
.sticky-note,
.chalk-doodle {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.decor-pencil {
  width: 160px;
  height: 15px;
  top: 112px;
  right: -22px;
  border: 1px solid rgba(68,48,10,.25);
  border-radius: 8px 3px 3px 8px;
  background: linear-gradient(90deg, #ef8e9c 0 11%, #d9dde0 11% 16%, #f3c746 16% 84%, #d3a52d 84% 88%, #ead3a5 88% 96%, #303742 96%);
  transform: rotate(-10deg);
}

.decor-ruler {
  width: 165px;
  height: 28px;
  left: -58px;
  bottom: 118px;
  border: 1px solid rgba(102,73,13,.3);
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(83,62,17,.4) 10px 11px), rgba(244,196,73,.8);
  transform: rotate(67deg);
  opacity: .55;
}

.decor-eraser {
  width: 72px;
  height: 36px;
  top: 302px;
  left: -20px;
  border: 3px solid rgba(255,255,255,.18);
  border-radius: 9px;
  background: linear-gradient(90deg, #ef8d9d 0 63%, #ece7dc 63%);
  transform: rotate(-17deg);
  opacity: .68;
}

.sticky-note {
  top: 160px;
  right: 52px;
  width: 114px;
  min-height: 90px;
  padding: 18px 14px 12px;
  color: #53441d;
  border: 1px solid rgba(108,87,27,.12);
  border-radius: 3px;
  background: #fff0a5;
  box-shadow: 0 14px 26px rgba(0,0,0,.18);
  transform: rotate(5deg);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 11px;
}

.sticky-note::before {
  content: "";
  position: absolute;
  width: 42px;
  height: 12px;
  top: -8px;
  left: 50%;
  background: rgba(234,216,178,.76);
  transform: translateX(-50%) rotate(-2deg);
}

.chalk-doodle {
  color: rgba(229,245,232,.18);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 24px;
}

.chalk-doodle.one { left: 35px; top: 198px; transform: rotate(8deg); }
.chalk-doodle.two { right: 70px; bottom: 108px; transform: rotate(-7deg); }

.form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px;
  background:
    linear-gradient(90deg, transparent 0 7.5%, rgba(225,115,117,.08) 7.5% 7.65%, transparent 7.65%),
    repeating-linear-gradient(0deg, transparent 0 31px, var(--auth-paper-line) 31px 32px),
    var(--auth-paper);
}

.auth-topbar { justify-content: flex-end; }
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.form-center {
  width: min(100%, 480px);
  margin: auto;
  padding: 42px 0;
}

.auth-card {
  position: relative;
  padding: 34px;
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 18px 45px rgba(75, 62, 38, .09);
  backdrop-filter: blur(12px);
}

[data-theme="dark"] .auth-card,
[data-theme="dark"] .home-link,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .auth-link-button,
[data-theme="dark"] .password-toggle {
  background: rgba(6, 25, 31, .76);
}

.auth-card::before {
  content: "";
  position: absolute;
  width: 76px;
  height: 18px;
  top: -8px;
  left: 50%;
  background: rgba(227,211,178,.74);
  transform: translateX(-50%) rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(130,109,73,.06);
}

.form-kicker {
  margin: 0 0 10px;
  color: var(--auth-purple);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 39px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.auth-card .lead {
  margin: 14px 0 24px;
  color: var(--auth-muted);
  font-size: 15px;
}

.message {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 760;
}

.message-success {
  color: var(--auth-ok-tx);
  border: 1px solid var(--auth-ok-bd);
  background: var(--auth-ok-bg);
}

.message-error {
  color: var(--auth-danger-tx);
  border: 1px solid var(--auth-danger-bd);
  background: var(--auth-danger-bg);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 780;
}

.input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  padding: 12px 14px;
  color: var(--auth-ink);
  background: rgba(255,255,255,.86);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

[data-theme="dark"] .input {
  background: rgba(2, 16, 21, .72);
}

.input:focus {
  border-color: rgba(109, 74, 255, .48);
  box-shadow: 0 0 0 4px rgba(109, 74, 255, .12);
}

.field-help {
  color: var(--auth-muted);
  font-size: 12px;
}

.password-wrap {
  position: relative;
}

.input.with-toggle {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 40px;
  min-height: 36px;
  padding: 0;
  transform: translateY(-50%);
}

.password-toggle:hover {
  transform: translateY(-50%);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.password-toggle svg[hidden] {
  display: none;
}

.row-links,
.card-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.link {
  color: var(--auth-purple);
  font-size: 14px;
  font-weight: 820;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-note {
  max-width: 230px;
  color: var(--auth-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.button-primary {
  min-height: 50px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(109, 74, 255, .18);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-purple), var(--auth-purple-2));
  box-shadow: 0 13px 28px rgba(109, 74, 255, .28);
  font-weight: 850;
  transition: transform .2s, box-shadow .2s;
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 17px 34px rgba(109, 74, 255, .36);
}

.form-footer {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  text-align: center;
}

.form-note,
.auth-footer {
  color: var(--auth-muted);
  font-size: 13px;
}

.form-footer .auth-link-button {
  width: 100%;
}

.card-links {
  margin-top: 18px;
}

.terms-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  background: rgba(255,255,255,.58);
}

[data-theme="dark"] .terms-row {
  background: rgba(2, 16, 21, .44);
}

.terms-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--auth-purple);
}

.terms-text {
  color: var(--auth-muted);
  font-size: 13px;
  font-weight: 620;
}

.terms-text a {
  color: var(--auth-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-footer {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
}

.compact-brand {
  display: none;
}

@media (max-width: 920px) {
  .auth-shell {
    padding: 0;
  }

  .auth-layout {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .visual-panel {
    min-height: 230px;
    padding: 24px;
  }

  .panel-copy {
    max-width: 720px;
    margin-top: 38px;
  }

  .panel-copy h1 {
    font-size: clamp(34px, 7vw, 48px);
  }

  .panel-copy p {
    max-width: 650px;
  }

  .benefit-list,
  .chalk-card,
  .decor-ruler,
  .decor-eraser,
  .sticky-note,
  .chalk-doodle {
    display: none;
  }

  .tool-strip {
    left: 24px;
    right: 24px;
    bottom: 18px;
  }

  .form-panel {
    min-height: calc(100vh - 230px);
  }
}

@media (max-width: 620px) {
  .visual-panel {
    min-height: 190px;
    padding: 18px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .visual-panel .home-link {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 13px;
  }

  .panel-copy {
    margin-top: 28px;
  }

  .panel-copy p {
    display: none;
  }

  .decor-pencil {
    top: 88px;
    right: -58px;
    transform: rotate(-12deg) scale(.86);
  }

  .form-panel {
    padding: 18px;
  }

  .auth-topbar {
    align-items: flex-start;
  }

  .compact-brand {
    display: inline-flex;
    color: var(--auth-ink);
  }

  .compact-brand .brand-mark {
    border-color: var(--auth-border);
    background: linear-gradient(145deg, rgba(243,199,70,.3), rgba(25,195,230,.14));
  }

  .form-center {
    padding: 24px 0;
  }

  .auth-card {
    padding: 28px 20px 22px;
    border-radius: 18px;
  }

  .row-links,
  .card-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .back-note {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
