
:root {
  --cream: #EEDCC8;
  --paper: #fffaf4;
  --wine: #5D0703;
  --plum: #37192c;
  --rose: #ead0d7;
  --rose-light: #f7e9e8;
  --gold: #c49a63;
  --text: #402b29;
  --muted: #8a716a;
  --border: #e7d2c3;
  --success: #55734d;
  --danger: #a13d3d;
  --shadow: 0 12px 35px rgba(93, 7, 3, .09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ENCABEZADO */

.site-header {
  padding: 22px 18px;
  background: var(--wine);
  color: var(--paper);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--paper);
  padding: 5px;
}

.brand-text h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 3px;
}

.brand-text p {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--cream);
}

/* CONTENIDO */

.main-container {
  width: min(100% - 30px, 760px);
  margin: 35px auto;
}

.view {
  animation: appear .35s ease;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.welcome-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 23px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.welcome-card {
  text-align: center;
  padding: 48px 30px;
}

.eyebrow {
  color: var(--wine);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 3px;
}

h2 {
  color: var(--wine);
  font-size: 30px;
  margin: 12px 0;
}

h3 {
  color: var(--wine);
  margin-top: 0;
}

.muted,
.field-note {
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.welcome-actions {
  display: grid;
  gap: 12px;
  max-width: 330px;
  margin: 28px auto 0;
}

/* BOTONES */

button {
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  background: var(--wine);
  color: white;
  font-weight: bold;
  transition: .2s ease;
}

button:hover {
  background: #7b1711;
  transform: translateY(-1px);
}

button:active {
  transform: scale(.98);
}

button.secondary {
  background: var(--rose);
  color: var(--wine);
}

button.secondary:hover {
  background: #dfbdc8;
}

.text-button,
.back-button,
.quiet-btn {
  background: transparent;
  color: var(--wine);
  padding: 9px 4px;
}

.text-button:hover,
.back-button:hover,
.quiet-btn:hover {
  background: var(--rose-light);
}

.back-button {
  margin-bottom: 15px;
}

.quiet-btn {
  border: 1px solid var(--border);
  padding: 9px 13px;
}

/* FORMULARIOS */

form {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

label {
  color: var(--plum);
  font-size: 13px;
  font-weight: bold;
  margin-top: 5px;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: white;
  color: var(--text);
}

input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(93, 7, 3, .08);
}

input::placeholder {
  color: #b7a49b;
}

.field-note {
  margin: 0;
  font-size: 12px;
}

/* MENSAJES */

.message {
  min-height: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

/* TARJETA DE CLIENTA */

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

.section-top h2,
.section-top h3 {
  margin-bottom: 8px;
}

.client-code-card {
  margin: 25px 0;
  padding: 22px;
  border-radius: 18px;
  background: var(--wine);
  color: var(--paper);
  text-align: center;
}

.client-code-card span {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cream);
}

.client-code-card strong {
  display: block;
  margin-top: 10px;
  font-size: 27px;
  letter-spacing: 2px;
}

.loyalty-progress {
  padding: 22px;
  background: var(--rose-light);
  border-radius: 17px;
}

.loyalty-progress p {
  color: var(--wine);
  font-size: 13px;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  margin: 18px 0;
}

.stamp {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px dashed var(--wine);
  border-radius: 50%;
  color: var(--wine);
  font-size: 23px;
  background: var(--paper);
}

.stamp.filled {
  background: var(--wine);
  color: var(--cream);
  border-style: solid;
}

.content-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.birthday-message {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  background: var(--cream);
  text-align: center;
  border: 1px solid var(--gold);
}

.birthday-message h3 {
  margin-bottom: 8px;
}

.birthday-message p {
  font-size: 13px;
  line-height: 1.6;
}

/* HISTORIAL Y RECOMPENSAS */

.history-list {
  display: grid;
  gap: 10px;
}

.history-item,
.reward-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
}

.history-item b,
.history-item small {
  display: block;
}

.history-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.history-item strong,
.reward-item b {
  color: var(--wine);
  white-space: nowrap;
}

.reward-item {
  flex-wrap: wrap;
  font-size: 13px;
}

.empty {
  padding: 17px;
  border-radius: 12px;
  background: var(--rose-light);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ADMINISTRACIÓN */

.admin-panel {
  overflow: hidden;
}

.search-form {
  display: grid;
  gap: 11px;
}

.client-admin-card {
  margin-top: 22px;
  padding: 20px;
  background: var(--rose-light);
  border-radius: 16px;
  overflow-wrap: anywhere;
}

.client-admin-card h3 {
  margin-top: 12px;
}

.client-admin-card p {
  font-size: 13px;
  line-height: 1.7;
}

.subsection {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.subsection input {
  margin: 10px 0 15px;
}

.directory-open {
  white-space: nowrap;
  flex-shrink: 0;
}

/* CELEBRACIÓN DE RECOMPENSAS */

#kori-celebration {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 9, 9, .78);
  animation: celebrationFade .35s ease;
}

.kori-celebration-card {
  position: relative;
  width: min(100%, 460px);
  padding: 42px 25px;
  border: 2px solid var(--gold);
  border-radius: 25px;
  background: var(--paper);
  text-align: center;
  box-shadow: 0 0 50px rgba(238, 220, 200, .25);
  animation: celebrationPop .55s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}

.kori-sparkles {
  color: var(--gold);
  font-size: 25px;
  letter-spacing: 8px;
  animation: sparkle 1.5s ease-in-out infinite alternate;
}

.kori-celebration-flower {
  margin: 12px 0;
  color: var(--wine);
  font-size: 55px;
}

.kori-celebration-small {
  color: var(--wine);
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: bold;
}

.kori-celebration-card h2 {
  font-size: 27px;
}

.kori-discount {
  display: grid;
  place-items: center;
  width: 125px;
  height: 125px;
  margin: 22px auto;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: var(--wine);
  color: var(--cream);
  font-size: 43px;
  font-weight: bold;
  box-shadow: 0 0 0 8px var(--rose-light);
}

.kori-celebration-card > p:not(.kori-celebration-small) {
  color: var(--muted);
  font-size: 15px;
}

.kori-celebration-card button {
  width: 100%;
  margin-top: 18px;
}

@keyframes celebrationFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes celebrationPop {
  from {
    opacity: 0;
    transform: scale(.75);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sparkle {
  from { opacity: .55; transform: scale(.95); }
  to { opacity: 1; transform: scale(1.08); }
}

/* PIE DE PÁGINA */

.site-footer {
  padding: 25px 15px;
  text-align: center;
  color: var(--wine);
  font-size: 12px;
}

.site-footer p {
  font-weight: bold;
  letter-spacing: 3px;
  margin-bottom: 5px;
}

.site-footer span {
  color: var(--muted);
}

/* CELULARES */

@media (max-width: 520px) {
  .main-container {
    width: min(100% - 20px, 760px);
    margin: 20px auto;
  }

  .panel,
  .welcome-card {
    padding: 22px 17px;
    border-radius: 18px;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
  }

  .brand-text h1 {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .brand-text p {
    font-size: 10px;
  }

  h2 {
    font-size: 25px;
  }

  .stamp {
    font-size: 18px;
  }

  .stamps {
    gap: 6px;
  }

  .history-item,
  .reward-item {
    align-items: flex-start;
  }

  .kori-celebration-card {
    padding: 32px 18px;
  }
}
