/* ── Mindful Savor Survey Platform — Shared Styles ─────────── */

:root {
  --teal:      #2D6A4F;
  --teal-mid:  #95C9AE;
  --teal-lt:   #D8EDE3;
  --dark:      #12132A;
  --gold:      #B8960C;
  --white:     #FFFFFF;
  --offwhite:  #F6F9F7;
  --grey:      #6B7280;
  --grey-lt:   #F3F4F6;
  --red:       #DC2626;
  --shadow:    0 2px 12px rgba(18,19,42,.10);
  --radius:    10px;
  --radius-sm: 6px;
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--offwhite);
  color: var(--dark);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ──────────────────────────────────────────────── */
h1 { font-size: 1.8rem; font-weight: 700; color: var(--teal); }
h2 { font-size: 1.35rem; font-weight: 600; color: var(--dark); margin-bottom: .5rem; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--dark); margin-bottom: .4rem; }

/* ── Layout ──────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 700px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Admin sidebar layout ────────────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 230px;
  background: var(--dark);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.admin-sidebar .logo {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-sidebar .logo span {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: .04em;
}

.admin-sidebar .logo em {
  color: var(--teal-mid);
  font-style: normal;
}

.admin-sidebar nav { flex: 1; padding: 1rem 0; }

.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  transition: background .15s, color .15s;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(45,106,79,.35);
  color: var(--white);
  text-decoration: none;
}

.admin-sidebar nav a .icon { font-size: 1rem; width: 1.2rem; text-align: center; }

.admin-sidebar .sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar h1 { font-size: 1.3rem; margin: 0; }

.admin-content { padding: 1.75rem 1.5rem; flex: 1; overflow-y: auto; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--teal-lt);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.btn-primary:hover { background: #235540; border-color: #235540; }

.btn-secondary {
  background: var(--white);
  color: var(--teal);
  border-color: var(--teal);
}
.btn-secondary:hover { background: var(--teal-lt); }

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover { background: #fef2f2; }

.btn-dark {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.btn-dark:hover { background: #1e1f3a; }

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: .35rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}

textarea { resize: vertical; min-height: 90px; }
select { appearance: auto; }

.form-hint {
  font-size: .8rem;
  color: var(--grey);
  margin-top: .25rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.data-table th {
  background: var(--teal);
  color: var(--white);
  padding: .65rem .9rem;
  text-align: left;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .03em;
}

.data-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--teal-lt); }

/* ── Badges / pills ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}

.badge-green  { background: #dcfce7; color: #166534; }
.badge-grey   { background: #f3f4f6; color: #6b7280; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-teal   { background: var(--teal-lt); color: var(--teal); }

/* ── Alert / Flash ───────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .92rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.alert-success { background: #f0fdf4; border-left: 4px solid #22c55e; color: #166534; }
.alert-error   { background: #fef2f2; border-left: 4px solid var(--red); color: #991b1b; }
.alert-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }

/* ── Stat cards ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--teal);
}

.stat-card .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  margin-bottom: .3rem;
}

.stat-card .stat-label {
  font-size: .82rem;
  color: var(--grey);
  font-weight: 500;
}

/* ── Survey (consumer-facing) ────────────────────────────────── */
.survey-shell {
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem 3rem;
}

.survey-header {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.survey-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: .04em;
}
.survey-logo em { color: var(--teal-mid); font-style: normal; }

.survey-card {
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border-radius: 16px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}

.survey-progress {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.progress-bar-outer {
  flex: 1;
  height: 6px;
  background: var(--grey-lt);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
  transition: width .4s ease;
}

.progress-text {
  font-size: .78rem;
  color: var(--grey);
  white-space: nowrap;
}

.survey-question {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .5rem;
  line-height: 1.4;
}

.survey-helper {
  font-size: .88rem;
  color: var(--grey);
  margin-bottom: 1.5rem;
}

/* Choice options */
.option-list { display: flex; flex-direction: column; gap: .6rem; }

.option-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.option-item:hover { border-color: var(--teal-mid); background: var(--teal-lt); }
.option-item.selected { border-color: var(--teal); background: var(--teal-lt); }

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  width: auto;
  accent-color: var(--teal);
  flex-shrink: 0;
  cursor: pointer;
}

.option-label { font-size: .97rem; color: var(--dark); cursor: pointer; }

/* Rating stars */
.rating-row {
  display: flex;
  gap: .6rem;
  margin: .5rem 0 1rem;
}

.rating-btn {
  flex: 1;
  padding: .75rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--grey);
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}

.rating-btn:hover,
.rating-btn.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--grey);
  margin-top: .35rem;
}

/* Text inputs in survey */
.survey-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--dark);
  transition: border-color .15s;
  margin-bottom: .5rem;
}

.survey-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}

.survey-nav {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}

/* Thank you screen */
.thankyou-icon {
  width: 72px;
  height: 72px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--white);
  margin: 0 auto 1.25rem;
}

.thankyou-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: .5rem;
  text-align: center;
}

.thankyou-msg {
  color: var(--grey);
  text-align: center;
  margin-bottom: 1.5rem;
}

.countdown { font-size: .82rem; color: var(--grey); text-align: center; margin-top: 1rem; }

/* Ambassador view */
.activation-hero {
  background: linear-gradient(135deg, var(--teal), #1e5540);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}

.activation-hero h2 { color: var(--white); font-size: 1.4rem; }
.activation-hero p  { color: var(--teal-lt); font-size: .9rem; margin-top: .25rem; }

.counter-big {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--teal);
  text-align: center;
  line-height: 1;
}

.counter-label {
  font-size: .82rem;
  color: var(--grey);
  text-align: center;
  margin-top: .2rem;
}

/* QR code display */
.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  border: 2px dashed var(--teal-mid);
  border-radius: var(--radius);
  background: var(--teal-lt);
  margin-bottom: 1rem;
}

.qr-block img { margin-bottom: .75rem; }
.qr-block .qr-url { font-size: .8rem; color: var(--grey); word-break: break-all; }

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 1rem; }
  .survey-card { padding: 1.5rem 1.25rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .survey-question { font-size: 1.05rem; }
}
