* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(1.65rem, 2.4vw, 2.35rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 1.08rem; line-height: 1.25; }
p { color: var(--text-2); line-height: 1.55; }
small { color: var(--text-2); }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.optional { color: var(--muted); font-weight: 500; }
.eyebrow { margin-bottom: 7px; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

/* Action controls: only four families — primary, secondary, danger and icon.
   Google keeps its own brand treatment but shares the same geometry. */
.primary-button, .secondary-button, .danger-button, .google-button {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  padding: 0 16px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .86rem;
  line-height: 1;
  font-weight: 760;
  white-space: nowrap;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease, color .14s ease;
}
.primary-button { background: var(--brand); color: #fff; border-color: var(--brand); }
.primary-button:hover { background: var(--brand-strong); border-color: var(--brand-strong); transform: translateY(-1px); }
.secondary-button { background: var(--surface); color: var(--text); border-color: var(--line); }
.secondary-button:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 58%, var(--line)); color: var(--brand-strong); }
.danger-button { background: var(--danger); color: #fff; border-color: var(--danger); }
.danger-button:hover { filter: brightness(.94); transform: translateY(-1px); }
.google-button { background: var(--surface); color: var(--text); border-color: var(--line); }
.icon-button {
  width: var(--icon-control);
  height: var(--icon-control);
  min-width: var(--icon-control);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  line-height: 1;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.icon-button:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, var(--line)); color: var(--danger); }
.primary-button:focus-visible, .secondary-button:focus-visible, .danger-button:focus-visible, .google-button:focus-visible, .icon-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

label { display: grid; gap: 8px; color: var(--text); font-size: .84rem; line-height: 1.25; font-weight: 750; }
input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); background-color: var(--surface); color: var(--text);
  border-radius: var(--control-radius); outline: 0; font-size: .88rem; line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select {
  height: var(--control-height); min-height: var(--control-height); padding: 0 14px;
}
select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 42px; font-weight: 680;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23465B65' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px 16px;
}
textarea { min-height: 108px; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
input[type="color"] { min-height: var(--control-height); padding: 4px; }
.form-stack { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-error { margin: 0; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent); border-radius: var(--control-radius); background: var(--danger-soft); color: var(--danger); font-size: .82rem; line-height: 1.45; font-weight: 650; }
.settings-hint { margin: 0; color: var(--text-2); font-size: .8rem; line-height: 1.45; }
.clean-fieldset { margin: 0; padding: 0; border: 0; }
.clean-fieldset legend { margin-bottom: 10px; font-size: .88rem; font-weight: 750; }

:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23AABBC2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}

/* 0.22.2 · select nativo limpio en Safari/tema oscuro */
select {
  background-repeat: no-repeat !important;
  background-position: right 13px center !important;
  background-size: 16px 16px !important;
}
