:root {
    --azul: #0ea5e9;
    --azul-oscuro: #071e36;
    --azul-medio: #0056a3;
    --celeste: #7bcce8;
    --negro: #0f172a;
    --blanco: #ffffff;
    --gris-claro: #f5f5f5;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    font-family: 'Barlow', sans-serif;
    color: var(--azul-oscuro);
    background:
      radial-gradient(circle at top left, rgba(123,204,232,0.22), transparent 35%),
      linear-gradient(180deg, #f7fbff 0%, #eef4fb 55%, #ffffff 100%);
  }

  a { color: inherit; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.25rem;
    background: rgba(8,24,43,0.97);
    color: var(--blanco);
    border-bottom: 1px solid rgba(123,204,232,0.18);
    backdrop-filter: blur(12px);
  }

  .brand {
    text-decoration: none;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--blanco);
  }

  .brand span { color: var(--celeste); }

  .top-links {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .auth-menu {
    position: relative;
    display: flex;
    align-items: center;
  }

  .auth-menu-button {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(123,204,232,0.35);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--blanco);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }

  .auth-menu-button:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(123,204,232,0.55);
    transform: translateY(-1px);
  }

  .auth-menu-button svg,
  .auth-menu-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  .auth-menu-panel {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    min-width: 220px;
    padding: 0.55rem;
    border-radius: 16px;
    background: rgba(13,31,66,0.98);
    border: 1px solid rgba(123,204,232,0.18);
    box-shadow: 0 24px 55px rgba(5,17,42,0.28);
    display: grid;
    gap: 0.4rem;
    z-index: 120;
  }

  .auth-menu-panel[hidden] { display: none; }

  .auth-menu-label {
    padding: 0.45rem 0.65rem 0.2rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
  }

  .auth-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--blanco);
    text-decoration: none;
    text-align: left;
    font: inherit;
    padding: 0.8rem 0.8rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .auth-menu-item:hover {
    background: rgba(255,255,255,0.08);
  }

  .auth-menu-item[hidden] {
    display: none;
  }

  .auth-menu-item.danger {
    color: #ffd7d7;
  }

  .auth-menu-item.danger:hover {
    background: rgba(255,110,110,0.12);
  }

  .top-link {
    text-decoration: none;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.72rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(123,204,232,0.2);
    background: rgba(255,255,255,0.06);
  }

  .top-link.primary {
    background: var(--celeste);
    color: var(--negro);
    border-color: transparent;
  }

  .page {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
  }

  .hero {
    padding: 2rem 0 1.25rem;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--azul);
    margin-bottom: 0.9rem;
  }

  .eyebrow::before {
    content: '';
    width: 34px;
    height: 2px;
    background: var(--celeste);
  }

  h1 {
    margin: 0 0 0.65rem;
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 1.02;
    color: var(--azul-oscuro);
  }

  .lead {
    margin: 0;
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #42546f;
  }

  .grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    margin-top: 1.6rem;
  }

  @media (min-width: 980px) {
    .grid {
      grid-template-columns: 380px 1fr;
    }
  }

  .card {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(14,165,233,0.1);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(14,165,233,0.08);
    overflow: hidden;
  }

  .card-header {
    padding: 1.25rem 1.25rem 0;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card h2 {
    margin: 0 0 0.4rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--azul-oscuro);
  }

  .card p {
    margin: 0;
    line-height: 1.6;
    color: #94a3b8;
  }

  .status {
    margin-top: 0.85rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(123,204,232,0.12);
    border: 1px solid rgba(123,204,232,0.18);
    color: #17416a;
    line-height: 1.55;
    font-size: 0.95rem;
  }

  .status.error {
    background: rgba(255,85,85,0.1);
    border-color: rgba(255,85,85,0.18);
    color: #8d1e1e;
  }

  .status.success {
    background: rgba(54,180,104,0.1);
    border-color: rgba(54,180,104,0.18);
    color: #1d6a3b;
  }

  .field {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.85rem;
  }

  .field label {
    font-weight: 700;
    color: #33465f;
    font-size: 0.92rem;
  }

  .field input,
  .field textarea,
  .field select {
    width: 100%;
    border: 1px solid rgba(14,165,233,0.14);
    border-radius: 14px;
    padding: 0.9rem 0.95rem;
    font: inherit;
    background: #fff;
    color: #1e2c44;
    outline: none;
  }

  .field textarea {
    min-height: 120px;
    resize: vertical;
  }

  .field input:focus,
  .field textarea:focus,
  .field select:focus {
    border-color: rgba(123,204,232,0.8);
    box-shadow: 0 0 0 4px rgba(123,204,232,0.14);
  }

  .editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid rgba(14,165,233,0.14);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    background: rgba(123,204,232,0.08);
  }

  .editor-btn {
    border: 1px solid rgba(14,165,233,0.16);
    background: #fff;
    color: #1e2c44;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
  }

  .editor-btn:hover {
    background: rgba(123,204,232,0.18);
  }

  .editor-btn.active {
    background: var(--celeste, #7bcce8);
    border-color: transparent;
  }

  .editor-sep {
    width: 1px;
    background: rgba(14,165,233,0.14);
    margin: 0 0.15rem;
  }

  .editor-body {
    min-height: 200px;
    border: 1px solid rgba(14,165,233,0.14);
    border-radius: 0 0 14px 14px;
    padding: 0.9rem 0.95rem;
    background: #fff;
    color: #1e2c44;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
  }

  .editor-body:focus {
    border-color: rgba(123,204,232,0.8);
    box-shadow: 0 0 0 4px rgba(123,204,232,0.14);
  }

  .editor-body:empty::before {
    content: attr(data-placeholder);
    color: rgba(30,44,68,0.4);
  }

  .editor-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin: 0.6rem 0 0.4rem;
  }

  .editor-body p {
    margin: 0 0 0.6rem;
  }

  .editor-body ul,
  .editor-body ol {
    margin: 0 0 0.6rem 1.3rem;
    padding: 0;
  }

  .editor-body a {
    color: #1c4a7a;
    text-decoration: underline;
  }

  .split {
    display: grid;
    gap: 0.85rem;
  }

  @media (min-width: 700px) {
    .split {
      grid-template-columns: 1fr 1fr;
    }
  }

  .actions {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 1fr 1fr;
    margin-top: 1rem;
  }

  .btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .btn:hover { transform: translateY(-2px); }

  .btn.primary {
    background: var(--celeste);
    color: var(--negro);
  }

  .btn.secondary {
    background: rgba(8,24,43,0.08);
    color: var(--azul-oscuro);
    border: 1px solid rgba(8,24,43,0.12);
  }

  .btn.full {
    width: 100%;
    margin-top: 0.9rem;
  }

  .session {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.95rem;
    border-radius: 16px;
    background: rgba(123,204,232,0.12);
    border: 1px solid rgba(123,204,232,0.18);
  }

  .session strong {
    color: var(--azul-oscuro);
    font-size: 0.95rem;
  }

  .session code {
    font-family: inherit;
    color: #1c4a7a;
    word-break: break-word;
  }

  .helper {
    margin-top: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(123,204,232,0.14), rgba(255,255,255,0.82));
    border: 1px solid rgba(123,204,232,0.18);
    color: #34526c;
    line-height: 1.6;
  }

  .form-lock {
    margin-top: 0.85rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(8,24,43,0.06);
    border: 1px dashed rgba(8,24,43,0.18);
    color: #475d78;
  }

  .disabled {
    opacity: 0.55;
    pointer-events: none;
  }

  footer {
    padding: 1.5rem 0 2rem;
    text-align: center;
    color: #576a83;
    font-size: 0.92rem;
  }

  @media (max-width: 680px) {
    .topbar {
      flex-direction: column;
      align-items: flex-start;
    }
    .top-links {
      width: 100%;
      justify-content: flex-start;
    }
    .auth-menu {
      width: 100%;
      justify-content: center;
    }
    .auth-menu-button {
      width: 100%;
      border-radius: 12px;
      justify-content: center;
      padding: 0 0.9rem;
      gap: 0.7rem;
    }
    .auth-menu-button::after {
      content: 'Cuenta';
      font-family: 'Barlow Condensed', sans-serif;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .auth-menu-panel {
      position: static;
      min-width: 100%;
      margin-top: 0.45rem;
    }
    .actions,
    .split {
      grid-template-columns: 1fr;
    }
  }


