:root {
  --ink: #17130f;
  --surface: #fffaf1;
  --paper: #f3eadc;
  --line: rgba(43, 28, 18, .13);
  --muted: #7d7064;
  --tobacco: #78452c;
  --gold: #d8ad4f;
  --olive: #49624f;
  --wine: #6e2d3a;
  --charcoal: #100b08;
  --white: #fffef9;
  --shadow: 0 24px 60px rgba(33, 20, 12, .12);
  --radius: 8px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(73, 98, 79, .10), transparent 42%),
    linear-gradient(180deg, #fffaf1, var(--paper));
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 0 clamp(18px, 5vw, 54px);
  border-bottom: 1px solid rgba(216, 173, 79, .18);
  background: rgba(16, 11, 8, .92);
  color: var(--white);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(216, 173, 79, .42);
  color: var(--gold);
  font-family: var(--serif);
  font-weight: 900;
}
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1;
}
.brand em {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-style: normal;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 254, 249, .74);
  font-weight: 800;
  font-size: .86rem;
}
.ghost-button,
.text-button,
.icon-button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
}
.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(216, 173, 79, .28);
  border-radius: 999px;
  color: var(--gold);
}

main {
  width: min(calc(100% - 36px), 1180px);
  margin: 0 auto;
}
.auth-view {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  padding: 58px 0;
}
.auth-copy h1,
.dashboard-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  line-height: .94;
  letter-spacing: 0;
}
.auth-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--tobacco);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.trust-list span,
.plan-card span,
.panel-heading span,
.dialog-heading span {
  display: inline-flex;
  color: var(--tobacco);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.trust-list span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, .72);
}
.auth-card,
.panel,
.plan-card,
.benefit-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, .82);
  box-shadow: var(--shadow);
}
.auth-card {
  padding: 24px;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(23, 19, 15, .06);
}
.tab {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
}
.tab.active {
  background: var(--charcoal);
  color: var(--gold);
}
.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.auth-form[hidden] { display: none; }
label {
  display: block;
  color: rgba(23, 19, 15, .74);
  font-weight: 850;
}
input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  min-height: 48px;
  border: 1px solid rgba(43, 28, 18, .16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .70);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}
textarea {
  min-height: 94px;
  padding-top: 12px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 173, 79, .18);
}
.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  font-weight: 650;
  color: rgba(23, 19, 15, .68);
}
.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}
.legal-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(73, 98, 79, .22);
  border-radius: var(--radius);
  background: rgba(73, 98, 79, .08);
}
.legal-box strong {
  display: block;
}
.legal-box span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .82rem;
}
.text-button {
  color: var(--olive);
  white-space: nowrap;
}
.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #c1903e);
  color: #1a1008;
  font-weight: 950;
  box-shadow: 0 16px 36px rgba(216, 173, 79, .24);
}
.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--wine);
  font-weight: 850;
}

.dashboard-view {
  padding: 44px 0 72px;
}
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}
.dashboard-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}
.dashboard-hero p {
  margin: 12px 0 0;
  color: var(--muted);
}
.plan-card {
  padding: 24px;
  background: var(--plan-bg, linear-gradient(135deg, rgba(16, 11, 8, .96), rgba(41, 25, 16, .94)));
  color: var(--plan-text, var(--white));
  border-radius: var(--radius-lg, 22px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 38px rgba(0,0,0,.18);
}
.plan-card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.20);
  pointer-events: none;
}
.plan-card.black::after {
  border-color: rgba(216,173,79,.34);
}
.plan-card.bronze {
  --plan-bg: linear-gradient(145deg, #d0a06e 0%, #c79a68 42%, #87532d 100%);
  --plan-text: #1a1008;
  --plan-muted: rgba(26, 16, 8, .75);
  --plan-accent: #4e2b18;
}
.plan-card.plata {
  --plan-bg: linear-gradient(145deg, #f0eee8 0%, #d4d1ca 48%, #9c9589 100%);
  --plan-text: #1a1008;
  --plan-muted: rgba(26, 16, 8, .75);
  --plan-accent: #56514a;
}
.plan-card.oro {
  --plan-bg: linear-gradient(145deg, #f4cd68 0%, #d8ad4f 50%, #9b7225 100%);
  --plan-text: #1a1008;
  --plan-muted: rgba(26, 16, 8, .75);
  --plan-accent: #50350d;
}
.plan-card.black {
  --plan-bg: linear-gradient(145deg, #27231f 0%, #171512 52%, #050403 100%);
  --plan-text: var(--white);
  --plan-muted: rgba(255, 254, 249, .68);
  --plan-accent: var(--gold-2);
}
.plan-card span {
  color: var(--plan-accent, var(--gold));
  font-size: .75rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.plan-card strong {
  display: block;
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}
.plan-card small {
  display: block;
  margin-top: 14px;
  color: var(--plan-muted, rgba(255, 254, 249, .68));
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.benefit-card {
  min-height: 128px;
  padding: 16px;
  box-shadow: none;
}
.benefit-card strong {
  display: block;
  margin-top: 8px;
  line-height: 1.12;
}
.benefit-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}
.benefit-card.locked {
  opacity: .58;
}
.benefit-card.unlocked {
  border-color: rgba(73, 98, 79, .34);
  background: rgba(255, 254, 249, .92);
}
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.panel {
  position: relative;
  padding: 22px;
}
.panel.wide {
  grid-column: 1 / -1;
}
.panel.gated.locked {
  opacity: .62;
}
.panel.gated.locked::after {
  content: "Requiere plan activo";
  position: absolute;
  inset: auto 18px 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(16, 11, 8, .92);
  color: var(--gold);
  font-weight: 950;
  text-align: center;
}
.panel-heading strong,
.dialog-heading strong {
  display: block;
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.08;
}
.list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.list-item {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(23, 19, 15, .05);
}
.list-item strong {
  display: block;
}
.list-item span {
  display: block;
  color: var(--tobacco);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.list-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.empty-state {
  padding: 16px;
  border: 1px dashed rgba(43, 28, 18, .22);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 750;
}
.inline-form,
.tasting-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.tasting-form {
  grid-template-columns: repeat(2, 1fr);
}
.span-2 {
  grid-column: 1 / -1;
}
.terms-dialog {
  width: min(720px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.terms-dialog::backdrop {
  background: rgba(16, 11, 8, .62);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(23, 19, 15, .08);
  color: var(--ink);
  font-size: 1.4rem;
}
.terms-content {
  max-height: min(70vh, 620px);
  overflow: auto;
  padding: 22px;
}
.terms-content article + article {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.terms-content h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
}
.terms-content p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .auth-view,
  .dashboard-hero,
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  main {
    width: min(calc(100% - 28px), 1180px);
  }
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .app-nav {
    flex-wrap: wrap;
  }
  .auth-view {
    grid-template-columns: 1fr;
    padding: 36px 0;
  }
  .auth-card {
    padding: 18px;
  }
  .benefits-grid,
  .tasting-form {
    grid-template-columns: 1fr;
  }
  .panel.wide,
  .span-2 {
    grid-column: auto;
  }
}
