/* =============================================
   FORTUNA STORE — CENTRO DE CÓDIGOS NETFLIX
   ============================================= */

:root {
  --netflix-red: #e50914;
  --access-danger: #ef4444;
  --access-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --access-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  --access-danger: #dc2626;
  --access-shadow: 0 18px 45px rgba(20, 20, 30, 0.10);
}

/* =============================================
   HEADER
   ============================================= */
.access-header {
  gap: 12px;
}

.access-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  font-family: var(--access-font);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition);
}

.access-header__back:hover { color: var(--color-gold); }
.access-header__back-arrow { font-size: 18px; line-height: 1; }
.access-header__search { max-width: 520px; }

/* =============================================
   CONTENIDO
   ============================================= */
.access-main {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 34px var(--page-pad) 68px;
  font-family: var(--access-font);
}

.access-main::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  left: 50%;
  width: min(560px, 90vw);
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(229, 9, 20, 0.09), transparent 66%);
  pointer-events: none;
}

/* =============================================
   PRESENTACIÓN
   ============================================= */
.access-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 22px;
}

.access-hero__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 5px;
  border-radius: 18px;
  overflow: hidden;
  background: #090909;
  border: 1px solid rgba(229, 9, 20, 0.32);
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.22);
}

.access-hero__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.access-hero__eyebrow {
  color: #ef3b44;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.access-hero__title {
  color: var(--color-text);
  font-family: var(--access-font);
  font-size: clamp(1.45rem, 4vw, 1.75rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.access-hero__subtitle {
  max-width: 390px;
  color: var(--color-text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* =============================================
   TARJETAS Y FORMULARIO
   ============================================= */
.access-card,
.code-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 96%, white 4%), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--access-shadow);
  overflow: hidden;
  animation: access-enter .28s ease both;
}

.access-card__header {
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--access-font);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.access-card__body { padding: 20px; }
.access-form .form-group + .form-group { margin-top: 17px; }

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--color-text);
  font-family: var(--access-font);
  font-size: 12.5px;
  font-weight: 650;
}

.form-input-wrap { position: relative; }

.form-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  outline: none;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: var(--access-font);
  font-size: 14.5px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input::placeholder { color: var(--color-text-muted); opacity: .82; }
.form-input:hover { border-color: color-mix(in srgb, var(--color-border) 55%, var(--color-text-muted) 45%); }
.form-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.10);
}
.form-input.has-error { border-color: var(--access-danger); }
.form-input--code { padding-right: 78px; }

.form-input__toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  min-width: 62px;
  height: 34px;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--color-text-muted);
  font-family: var(--access-font);
  font-size: 11.5px;
  font-weight: 700;
  transition: color var(--transition), background var(--transition);
}
.form-input__toggle:hover { color: var(--color-text); background: rgba(128, 128, 160, .08); }

.btn-consultar {
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  padding: 12px 18px;
  border-radius: 13px;
  background: var(--color-gold);
  color: #111;
  font-family: var(--access-font);
  font-size: 14.5px;
  font-weight: 780;
  box-shadow: 0 8px 22px rgba(245, 197, 24, .14);
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.btn-consultar:hover { background: var(--color-accent-2); transform: translateY(-1px); box-shadow: 0 11px 25px rgba(245, 197, 24, .18); }
.btn-consultar:active { transform: translateY(0); }
.btn-consultar:disabled { opacity: .58; cursor: wait; transform: none; box-shadow: none; }

/* =============================================
   ESTADOS
   ============================================= */
.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 42px 24px;
}

.state-card__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-size: 22px;
}
.state-card--warning .state-card__icon { background: rgba(245, 197, 24, .10); }
.state-card--danger .state-card__icon { background: rgba(239, 68, 68, .10); }

.state-card__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: access-spin .75s linear infinite;
}

.state-card__title {
  color: var(--color-text);
  font-family: var(--access-font);
  font-size: 1.06rem;
  font-weight: 740;
}

.state-card__text {
  max-width: 340px;
  color: var(--color-text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.state-card__actions {
  display: flex;
  flex-direction: column;
  width: min(100%, 250px);
  gap: 9px;
  margin-top: 6px;
}

.btn-outline,
.btn-whatsapp-sm {
  width: 100%;
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 12px;
  font-family: var(--access-font);
  font-size: 13px;
  font-weight: 720;
  transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
}

.btn-outline {
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-gold); color: var(--color-gold); transform: translateY(-1px); }
.btn-whatsapp-sm { background: #25d366; color: #fff; }
.btn-whatsapp-sm:hover { background: #20ba59; transform: translateY(-1px); }

/* =============================================
   ACCESO CORRECTO
   ============================================= */
.account-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 19px;
}

.account-summary__icon {
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 12px;
  flex-shrink: 0;
  background: #090909;
}
.account-summary__icon img { width: 100%; height: 100%; object-fit: cover; }
.account-summary__info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.account-summary__email {
  overflow: hidden;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-summary__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-summary__expiry { color: var(--color-text-muted); font-size: 11.5px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.status-pill__dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill--active { background: rgba(34, 197, 94, .11); color: var(--color-success); }
.status-pill--active .status-pill__dot { background: var(--color-success); }
.status-pill--expired { background: rgba(239, 68, 68, .10); color: var(--access-danger); }
.status-pill--expired .status-pill__dot { background: var(--access-danger); }
.status-pill--disabled { background: var(--color-surface-2); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.status-pill--disabled .status-pill__dot { background: var(--color-text-muted); }

.codes-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.code-card { box-shadow: var(--shadow-sm); }
.code-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 17px 12px;
  border-bottom: 1px solid var(--color-border);
}
.code-card__icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-2);
  font-size: 14px;
  flex-shrink: 0;
}
.code-card__title-wrap { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.code-card__title { color: var(--color-text); font-size: 13px; font-weight: 730; }
.code-card__updated { color: var(--color-text-muted); font-size: 10.5px; }
.code-card__body { padding: 16px 17px 17px; }

.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-2);
}
.code-box__value {
  flex: 1;
  color: var(--color-gold);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: .12em;
  word-break: break-word;
}
.code-box__copy {
  min-width: 68px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--access-font);
  font-size: 11.5px;
  font-weight: 720;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.code-box__copy:hover { border-color: var(--color-gold); color: var(--color-gold); }
.code-box__copy.is-copied { border-color: var(--color-success); color: var(--color-success); }

.code-card__empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: rgba(128, 128, 160, .06);
  color: var(--color-text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.code-card__empty-icon { flex-shrink: 0; font-size: 17px; }

.access-actions-row { display: flex; gap: 9px; margin-top: 15px !important; }
.access-support {
  padding-top: 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.access-support a { color: var(--color-gold); font-weight: 700; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 640px) {
  .codes-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .access-header { gap: 8px; }
  .access-header__back-text { display: none; }
  .access-header__search { max-width: none; }
  .access-main { padding-top: 24px; padding-bottom: 52px; }
  .access-hero { margin-bottom: 18px; }
  .access-hero__icon { width: 66px; height: 66px; border-radius: 16px; }
}

@media (max-width: 430px) {
  .access-header__back { width: 28px; justify-content: center; }
  .access-header__back-arrow { font-size: 20px; }
  .access-card__body { padding: 17px; }
  .access-card__header { padding-inline: 17px; }
  .access-actions-row { flex-direction: column; }
}

@keyframes access-spin { to { transform: rotate(360deg); } }
@keyframes access-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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