/* Circles Ai — pantalla de inicio de sesión
   Paleta oficial del sitio circles-ai.ai */

@font-face {
  font-family: Inter;
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-panel: #e8f4f8;
  --bg-input: #ffffff;
  --text: #0b0f1a;
  --text-muted: #3d4759;
  --text-subtle: #5c6778;
  --border: #d5dde7;
  --border-strong: #b7c2d0;
  --accent: #007a94;
  --accent-fill: #00d4ff;
  --accent-fill-text: #0b0f1a;
  --accent-soft: rgba(0, 212, 255, 0.18);
  --success: #0b7a5a;
  --success-bg: #e6f8f2;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warning: #8a5a00;
  --warning-bg: #fff6e0;
  --shadow: 0 18px 50px rgba(11, 15, 26, 0.1);
  --ring: 0 0 0 3px #ffffff, 0 0 0 6px #007a94;
  --radius: 20px;
  --radius-sm: 12px;
  --header-offset: 0px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #070a12;
    --bg-elevated: #11172a;
    --bg-panel: #0b0f1a;
    --bg-input: #0d1322;
    --text: #e5e7eb;
    --text-muted: #c5cad3;
    --text-subtle: #9aa3b2;
    --border: #2a3348;
    --border-strong: #3d4963;
    --accent: #00d4ff;
    --accent-fill: #00d4ff;
    --accent-fill-text: #0b0f1a;
    --accent-soft: rgba(0, 212, 255, 0.12);
    --success: #00e5a0;
    --success-bg: rgba(0, 229, 160, 0.12);
    --danger: #ff6b80;
    --danger-bg: rgba(255, 77, 109, 0.14);
    --warning: #ffb800;
    --warning-bg: rgba(255, 184, 0, 0.14);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --ring: 0 0 0 3px #0b0f1a, 0 0 0 6px #00d4ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070a12;
  --bg-elevated: #11172a;
  --bg-panel: #0b0f1a;
  --bg-input: #0d1322;
  --text: #e5e7eb;
  --text-muted: #c5cad3;
  --text-subtle: #9aa3b2;
  --border: #2a3348;
  --border-strong: #3d4963;
  --accent: #00d4ff;
  --accent-fill: #00d4ff;
  --accent-fill-text: #0b0f1a;
  --accent-soft: rgba(0, 212, 255, 0.12);
  --success: #00e5a0;
  --success-bg: rgba(0, 229, 160, 0.12);
  --danger: #ff6b80;
  --danger-bg: rgba(255, 77, 109, 0.14);
  --warning: #ffb800;
  --warning-bg: rgba(255, 184, 0, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 3px #0b0f1a, 0 0 0 6px #00d4ff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-panel: #e8f4f8;
  --bg-input: #ffffff;
  --text: #0b0f1a;
  --text-muted: #3d4759;
  --text-subtle: #5c6778;
  --border: #d5dde7;
  --border-strong: #b7c2d0;
  --accent: #007a94;
  --accent-fill: #00d4ff;
  --accent-fill-text: #0b0f1a;
  --accent-soft: rgba(0, 212, 255, 0.18);
  --success: #0b7a5a;
  --success-bg: #e6f8f2;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warning: #8a5a00;
  --warning-bg: #fff6e0;
  --shadow: 0 18px 50px rgba(11, 15, 26, 0.1);
  --ring: 0 0 0 3px #ffffff, 0 0 0 6px #007a94;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:focus {
  outline: none;
}

:focus-visible {
  box-shadow: var(--ring);
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--accent-fill);
  color: var(--accent-fill-text);
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.layout {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
}

.brand-panel {
  display: none;
  position: relative;
  overflow: hidden;
  color: #e5e7eb;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(0, 212, 255, 0.22), transparent 55%),
    radial-gradient(900px 500px at 110% 80%, rgba(0, 229, 160, 0.16), transparent 50%),
    linear-gradient(165deg, #0b0f1a 0%, #11172a 55%, #0b1324 100%);
  padding: 48px 56px;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(0, 212, 255, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.brand-panel::before {
  width: 420px;
  height: 420px;
  right: -80px;
  top: -60px;
}

.brand-panel::after {
  width: 280px;
  height: 280px;
  right: 40px;
  top: 40px;
  border-color: rgba(0, 229, 160, 0.14);
}

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
}

.logo img,
.logo svg {
  width: 36px;
  height: 36px;
  color: #00d4ff;
}

.eyebrow {
  margin: 0 0 12px;
  color: #00d4ff;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-panel h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: #fff;
}

.brand-panel .lead {
  margin: 0 0 32px;
  font-size: 1.0625rem;
  color: #c5cad3;
  max-width: 38ch;
}

.points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #e5e7eb;
}

.points svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: #00e5a0;
  margin-top: 1px;
}

.brand-foot {
  color: #9aa3b2;
  font-size: 0.875rem;
}

.form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 40px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}

.card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.card-logo svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

@media (min-width: 900px) {
  .card-logo {
    display: none;
  }

  .form-side {
    padding: 48px 32px;
  }

  .layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .brand-panel {
    display: block;
  }
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.card .subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
}

.form {
  display: grid;
  gap: 18px;
}

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

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.field-wrap {
  position: relative;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  caret-color: var(--accent);
}

input[type="password"] {
  padding-right: 48px;
}

input::placeholder {
  color: var(--text-subtle);
  opacity: 0.85;
}

input:hover {
  border-color: var(--accent);
}

.field.error input {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field-error {
  min-height: 0;
  font-size: 0.8125rem;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.toggle-password .icon-off { display: none; }
.toggle-password[aria-pressed="true"] .icon-on { display: none; }
.toggle-password[aria-pressed="true"] .icon-off { display: block; }

.caps-warning {
  display: none;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 0.8125rem;
  font-weight: 600;
}

.caps-warning.is-on {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin: 0;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.link:hover {
  text-decoration: underline;
}

.btn {
  appearance: none;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-fill);
  color: var(--accent-fill-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status {
  min-height: 1.25em;
  font-size: 0.9375rem;
}

.status[data-kind="error"] {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.status[data-kind="success"] {
  color: var(--success);
}

.alt {
  margin: 8px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.demo-hint {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: var(--accent-soft);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.demo-hint strong {
  color: var(--text);
  font-weight: 650;
}

.success-panel {
  text-align: center;
  padding: 16px 8px 8px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-bg);
  color: var(--success);
}

.success-icon svg {
  width: 28px;
  height: 28px;
}

.success-panel h2 {
  margin-bottom: 8px;
}

.success-panel p {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.page-footnote {
  margin-top: 20px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.8125rem;
}

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