/* =========================
   DineText Base Theme Tokens
   ========================= */
:root{
  /* Core Colours */
  --primary-blue: #0B4DB8;
  --primary-orange: #F36B21;

  /* Supporting Neutrals */
  --dark-navy: #082F6B;
  --light-grey: #B3B3B3;
  --white: #FFFFFF;

  /* Page neutrals (derived) */
  --page-bg: #f8f9fb;        /* keep your existing page tint */
  --text: var(--dark-navy);  /* main text */
  --muted: #6b7280;          /* readable muted text (better than #B3B3B3 for paragraphs) */
  --border: #d1d5db;         /* close to your current #ccc but cleaner */

  /* Feedback (keep your same vibe, just slightly aligned) */
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --success-bg: #dcfce7;
  --success-text: #166534;

  /* Typography */
  --font-sans: Inter, Poppins, "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* =========================
   CSS Reset and Base Styles
   ========================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { overflow-x: hidden; }

input, textarea, select {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 480px){
  input[type="datetime-local"]{
    width: 100%;
    max-width: 100%;
    display: block;
    -webkit-appearance: none;
    appearance: none;
  }
}

.card{ max-width: 100%; }

/* =========================
   Your Original Styles
   (layout preserved; only theme applied)
   ========================= */
body {
  max-width: 420px;
  margin: auto;
  padding: 40px 20px;
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text);
}

h2 {
  text-align: center;
  margin-bottom: 5px;
  color: var(--dark-navy);
  font-weight: 800;            /* a bit more “brand” */
  letter-spacing: -0.02em;
}

p.subtle {
  text-align: center;
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 25px;
  font-weight: 600;            /* medium → bold direction */
}

.card {
  background: var(--white);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(8, 47, 107, 0.08); /* slightly “navy” shadow */
  border: 1px solid rgba(8, 47, 107, 0.08);
}

label {
  font-weight: 700;            /* medium → bold */
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  color: var(--dark-navy);
}

.required-asterisk{
  color: #dc2626;
  margin-left: 2px;
  font-weight: 900;
}

input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--dark-navy);
  background: var(--white);
  outline: none;
}

input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.15);
}

select{
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--dark-navy);
  background: var(--white);
  outline: none;
}

select:focus{
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.15);
}

button {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  margin-top: 18px;

  /* Change from purple to your palette */
  background: var(--primary-orange);
  color: var(--white);
  font-weight: 800;
}

button:hover {
  opacity: 0.92;
}

.forgot-row{
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.forgot-link{
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-blue);
  text-decoration: none;
}

.forgot-link:hover{
  text-decoration: underline;
}

/* Optional: if you want the button to be blue instead, swap to:
button { background: var(--primary-blue); }
and use orange only for highlights.
*/

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(153, 27, 27, 0.15);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(22, 101, 52, 0.15);
}

ul.messages {
  padding-left: 0;
  margin-bottom: 15px;
}

ul.messages li {
  list-style: none;
}

.footer-text{
  text-align: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.footer-text a{
  color: var(--primary-blue);
  font-weight: 800;
  text-decoration: none;
}

.footer-text a:hover{
  text-decoration: underline;
}

/* Vertical spacing for stacked form fields */
textarea{
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  resize: vertical;
  color: var(--dark-navy);
  background: var(--white);
  outline: none;
}

textarea:focus{
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.15);
}

/* =========================
   Dashboard Utilities
   ========================= */
body{
  max-width: 1000px;         /* keeps your dashboard width */
  margin: auto;
  padding: 30px 20px;
}

.btn-group{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-toggle-row{
  margin-top: 12px;
}

.schedule-switch{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.schedule-switch input{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.schedule-slider{
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s ease;
}

.schedule-slider::before{
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.schedule-slider::after{
  content: "✓";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) scale(0.7);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.schedule-switch input:checked + .schedule-slider{
  background: #22c55e;
}

.schedule-switch input:checked + .schedule-slider::before{
  transform: translateX(24px);
}

.schedule-switch input:checked + .schedule-slider::after{
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.schedule-switch__text{
  color: var(--dark-navy);
  font-size: 14px;
  font-weight: 800;
}

.btn-link{ text-decoration:none; }

.btn{
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  width: auto;              /* dashboard buttons should not be full-width */
  margin-top: 0;            /* override login page button spacing */
}

.btn--primary{
  background: var(--primary-blue);
  color: var(--white);
}

.btn--secondary{
  background: #e5e7eb;
  color: var(--dark-navy);
}

.btn--danger{
  background: #dc2626;
  color: var(--white);
}

.btn:hover{ opacity: 0.92; }

.back-arrow{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  position: fixed;
  top: 18px;
  left: max(18px, calc((100vw - 1000px) / 2 + 20px));
  z-index: 30;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid rgba(8, 47, 107, 0.16);
  color: var(--dark-navy);
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(8, 47, 107, 0.10);
}

.back-arrow:hover{
  background: #eef4ff;
}

.search-form input[type="text"]{
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.table th{
  background: #f1f5f9;
  text-align: left;
  padding: 10px;
  font-weight: 800;
  color: var(--dark-navy);
}

.table td{
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.table tr:hover{ background: #f9fafb; }

.badge{
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.badge--yes{
  background: var(--success-bg);
  color: var(--success-text);
}

.badge--no{
  background: var(--error-bg);
  color: var(--error-text);
}

.footer-actions{
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Datetime input parity */
input[type="datetime-local"]{
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;

  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--dark-navy);
  background: var(--white);
  outline: none;
  box-sizing: border-box;
}

input[type="datetime-local"]:focus{
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.15);
}

/* Pending badge */
.badge--pending{
  background: #fef3c7;
  color: #92400e;
}

/* Inline action buttons in tables */
.inline-form{ display: inline; }

.btn--link{
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-blue);
  cursor: pointer;
  width: auto;
}

.btn--link:hover{
  text-decoration: underline;
  opacity: 0.9;
}

/* Keep long messages readable in table */
.message-log{
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

/* QR page */
.qr-wrap{
  display: flex;
  justify-content: center;
}

.qr-box{
  display: inline-block;
  padding: 20px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  margin: 15px 0;
  background: #fafafa;
}

.qr-box img{
  width: 230px;
  height: 230px;
}

.url-box{
  background: #f1f5f9;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  word-break: break-all;
  margin-top: 10px;
  color: var(--dark-navy);
}

.brand-logo{
  max-height: 60px;
  margin: 0 auto 10px;
  display: block;
}

.consent{
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}

/* Settings helpers */
.logo-preview{
  max-width: 120px;
  margin-bottom: 10px;
  border-radius: 6px;
  display: block;
}

/* Read-only input look */
.readonly{
  background: #f1f5f9;
  color: var(--dark-navy);
}

/* Divider */
.divider{
  border: none;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

/* Info alert (neutral/brand) */
.alert-info{
  background: rgba(11, 77, 184, 0.12);
  color: #1e3a8a;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(11, 77, 184, 0.18);
}

/* Small helper text */
.small-note{
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.4;
}

/* OTP / verification code input */
.otp-input{
  text-align: center;
  letter-spacing: 2px;
}

.table-wrap{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap .table{
  min-width: 560px;
}

/* =========================
   Dashboard: Feature Buttons (full-width + more color)
   ========================= */

.feature-stack{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Make feature buttons fill the card */
.feature-stack .btn{
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 10px;
}

.feature-stack .btn--dashboard{
  background: var(--white);
  color: #374151;
  border: 1px solid #d1d5db;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.10);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

/* Danger stays strong but nicer */
.feature-stack .btn--danger{
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.18);
}

/* Hover/focus polish */
.feature-stack .btn:hover{
  opacity: 1;
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.feature-stack .btn:active{
  transform: translateY(0px);
}

.feature-stack .btn:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(11, 77, 184, 0.18);
}

.action-icon{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--white);
  font-size: 14px;
  font-weight: 900;
}

.action-icon--blue{
  background: var(--primary-blue);
}

.action-icon--orange{
  background: var(--primary-orange);
}

.action-icon--slate{
  background: #4b5563;
}

/* Optional: on very wide screens, keep buttons a bit taller */
@media (min-width: 768px){
  .feature-stack .btn{
    padding: 16px 18px;
    font-size: 16px;
  }
}

/* Stats layout */
.stats-row{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card{
  flex: 1;
  min-width: 180px;
  background: var(--white);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid rgba(11, 77, 184, 0.12);
  box-shadow: 0 2px 10px rgba(8, 47, 107, 0.06);
}

/* =========================
   Dashboard: Stat Tiles (2-column grid like screenshot)
   ========================= */

.stats-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
}

/* Keep stat cards consistent on small screens */
@media (max-width: 420px){
  .stats-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-tile{
    padding: 10px 10px 9px;
  }

  .stat-top{
    gap: 8px;
  }

  .stat-icon{
    width: 30px;
    height: 30px;
  }

  .stat-icon svg{
    width: 15px;
    height: 15px;
  }

  .stat-label{
    font-size: 10px;
    line-height: 1.2;
  }

  .stat-value{
    font-size: 18px;
    margin-top: 6px;
  }
}

.stat-tile{
  border-radius: 12px;
  padding: 14px 14px 12px;
  border: 2px solid rgba(8, 47, 107, 0.12);
  box-shadow: 0 10px 18px rgba(8, 47, 107, 0.14);
  background: var(--white);
}

.stat-link{
  text-decoration: none;
  color: inherit;
  display: block;
}

.stat-link .stat-tile{
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.stat-link:hover .stat-tile{
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(8, 47, 107, 0.20);
}

.stat-top{
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.55);
  border: 2px solid rgba(255,255,255,0.72);
  color: var(--white);
}

.stat-icon svg{
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-icon--subscribers{
  background: linear-gradient(135deg, #2f80ff, #0b4db8);
  box-shadow: 0 4px 12px rgba(11, 77, 184, 0.38);
}

.stat-icon--messages{
  background: linear-gradient(135deg, #ffb46b, #f36b21);
  box-shadow: 0 4px 12px rgba(243, 107, 33, 0.36);
}

.stat-label{
  font-size: 12px;
  font-weight: 800;
  color: rgba(8, 47, 107, 0.85);
}

.stat-value{
  margin-top: 8px;
  font-size: 22px;
  font-weight: 900;
  color: var(--dark-navy);
  letter-spacing: -0.02em;
}

/* Color variants (match your palette, more “app-like”) */
.stat--green{
  background: linear-gradient(135deg, #e7f8ef, #c9f0dc);
  border-color: rgba(22, 163, 74, 0.18);
}

.stat--orange{
  background: linear-gradient(135deg, #fff3e8, #ffd7bf);
  border-color: rgba(243, 107, 33, 0.22);
}

.stat--blue{
  background: linear-gradient(135deg, #eaf2ff, #cfe1ff);
  border-color: rgba(11, 77, 184, 0.20);
}

.stat--red{
  background: linear-gradient(135deg, #ffecec, #ffd1d1);
  border-color: rgba(220, 38, 38, 0.22);
}

.stat--brand-blue{
  background: linear-gradient(135deg, #f1f6ff, #4f95ff);
  border-color: rgba(11, 77, 184, 0.50);
}

.stat--brand-orange{
  background: linear-gradient(135deg, #fff6eb, #ff9a4d);
  border-color: rgba(243, 107, 33, 0.50);
}

/* DineText brand logo (big everywhere) */
.logo-wrap{
  text-align: center;
}

.dinetext-logo{
  display: inline-block;   /* centers via text-align */
  width: 280px;
  max-width: 92%;
  height: auto;
  margin: 12px 0 16px;     /* no auto needed */
}

.restaurant-logo-large{
  display: inline-block;
  width: 280px;
  max-width: 92%;
  height: auto;
  max-height: 106px;
  object-fit: contain;
  margin: 12px 0 16px;
}

/* =========================
   Co-brand header (Restaurant × DineText)
   ========================= */
.cobrand{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px auto 14px;
  flex-wrap: nowrap;
  text-align: center;
}

.cobrand__logo{
  height: 56px;              /* unified size */
  width: auto;
  display: block;
  max-width: 42vw;
}

.cobrand__x{
  font-size: 22px;
  font-weight: 900;
  color: rgba(8, 47, 107, 0.55);
  line-height: 1;
}

/* Slight emphasis difference (optional) */
.cobrand__logo--restaurant{
  height: 52px;
}

.cobrand__logo--dinetext{
  height: 60px;
}

/* Dashboard logo tests: keep collab close to DineText-only while slightly de-emphasizing restaurant logo */
.cobrand--match-scale .cobrand__logo--dinetext{
  width: 280px;
  max-width: 42vw;
  height: auto;
  max-height: 106px;
}

.cobrand--match-scale .cobrand__logo--restaurant{
  width: 240px;
  max-width: 36vw;
  height: auto;
  max-height: 90px;
}

@media (max-width: 768px){
  body{
    padding: 18px 14px;
  }

  .card{
    padding: 16px;
  }

  .btn-group{
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn-link,
  .btn-group .inline-form{
    width: 100%;
  }

  .btn-group .btn{
    width: 100%;
  }

  .footer-actions{
    flex-direction: column;
    align-items: stretch;
  }

  .footer-actions .btn-link{
    width: 100%;
  }

  .footer-actions .btn{
    width: 100%;
  }

  .table th,
  .table td{
    padding: 8px;
    font-size: 13px;
  }

  .message-log{
    max-width: none;
  }

  .back-arrow{
    width: 34px;
    height: 34px;
    top: 12px;
    left: max(12px, calc((100vw - 1000px) / 2 + 14px));
  }

  .cobrand__logo--restaurant{
    height: 44px;
  }

  .cobrand__logo--dinetext{
    height: 50px;
  }

  .restaurant-logo-large{
    max-height: 84px;
  }

  .cobrand--match-scale .cobrand__logo--dinetext{
    max-width: 44vw;
    max-height: 84px;
  }

  .cobrand--match-scale .cobrand__logo--restaurant{
    max-width: 36vw;
    max-height: 72px;
  }
}

@media (max-width: 480px){
  .cobrand{
    gap: 8px;
  }

  .cobrand__logo--restaurant{
    height: 38px;
    max-width: 40vw;
  }

  .cobrand__logo--dinetext{
    height: 44px;
    max-width: 40vw;
  }

  .cobrand__x{
    font-size: 16px;
  }

  .restaurant-logo-large{
    max-height: 64px;
  }

  .cobrand--match-scale .cobrand__logo--dinetext{
    max-width: 44vw;
    max-height: 64px;
  }

  .cobrand--match-scale .cobrand__logo--restaurant{
    max-width: 34vw;
    max-height: 56px;
  }

  .qr-box{
    width: min(100%, 280px);
    padding: 12px;
  }

  .qr-box img{
    width: 100%;
    height: auto;
  }
}

body.has-bottom-nav{
  padding-bottom: 96px;
}

.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  border-top: 1px solid #dbe3ef;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.bottom-nav__inner{
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.bottom-nav__item{
  text-decoration: none;
  color: #6b7280;
  border-radius: 10px;
  padding: 5px 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.bottom-nav__icon{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e5e7eb;
  color: #374151;
  font-size: 14px;
  font-weight: 900;
}

.bottom-nav__item.is-active{
  background: rgba(11, 77, 184, 0.08);
}

.bottom-nav__item--send.is-active{
  color: #b45309;
}

.bottom-nav__item--send.is-active .bottom-nav__icon{
  background: linear-gradient(135deg, #fbbf24, #f36b21);
  color: #ffffff;
}

.bottom-nav__item--qr.is-active{
  color: var(--primary-blue);
}

.bottom-nav__item--qr.is-active .bottom-nav__icon{
  background: linear-gradient(135deg, #60a5fa, #0b4db8);
  color: #ffffff;
}

.bottom-nav__item--home.is-active{
  color: #1f2937;
}

.bottom-nav__item--home.is-active .bottom-nav__icon{
  background: linear-gradient(135deg, #64748b, #334155);
  color: #ffffff;
}

.bottom-nav__item--subs.is-active{
  color: #0f766e;
}

.bottom-nav__item--subs.is-active .bottom-nav__icon{
  background: linear-gradient(135deg, #2dd4bf, #0f766e);
  color: #ffffff;
}

.bottom-nav__item--logs.is-active{
  color: #be123c;
}

.bottom-nav__item--logs.is-active .bottom-nav__icon{
  background: linear-gradient(135deg, #fb7185, #be123c);
  color: #ffffff;
}

@media (max-width: 420px){
  body.has-bottom-nav{
    padding-bottom: 90px;
  }

  .bottom-nav__inner{
    padding-left: 4px;
    padding-right: 4px;
    gap: 2px;
  }

  .bottom-nav__icon{
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .bottom-nav__item{
    font-size: 9px;
  }
}
