:root {
    --bg: #ffffff;
    --card: #f7f9fc;
    --muted: #6b7280;
    --accent: #0f766e; /* teal/green */
    --accent-600: #0b6a62;
    --accent-100: #eefaf8;
    --danger: #ef4444;
    --glass: rgba(15,118,110,0.06);
    --radius: 14px;
    --max-width: 520px;
    --shadow: 0 6px 22px rgba(16,24,40,0.06);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}
/* add this to your style block */
.hidden {
    display: none !important;
}

#tokenForm .primary {
    background: linear-gradient(180deg,var(--accent),var(--accent-600));
    box-shadow: none;
}

#tokenForm .subtle {
    border-style: solid;
    border-color:#dadada;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.wrap {
    width: 100%;
    max-width: var(--max-width);
    border-right: 1px solid #dadada;
    border-left: 1px solid #dadada;
    height: 100vh;
}

.card {
    border-radius: 20px;
    padding: 18px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 6px 4px 12px 4px;
}

.logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .logo svg {
        width: 40px;
        height: 40px
    }

.title {
    line-height: 1.05;
}

    .title h1 {
        font-size: 18px;
        margin: 0;
        font-weight: 700
    }

    .title p {
        margin: 2px 0 0;
        font-size: 13px;
        color: var(--muted)
    }

.info {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(15,118,110,0.06);
    color: var(--accent-600);
    font-size: 13px;
    font-weight: 600;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
    margin-top: 18px;
}

.action {
    background: white;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 4px 18px rgba(16,24,40,0.04);
    border: 1px solid rgba(15,23,42,0.04);
    min-height: 62px;
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}


    .action:active {
        transform: translateY(1px)
    }

    .action svg {
        width: 28px;
        height: 28px;
        flex-shrink: 0
    }

    .action .label {
        display: flex;
        flex-direction: column;
        line-height: 17px;
        margin-top: 2px;
    }

        .action .label .name {
            font-weight: 600;
            font-size: 15px
        }

        .action .label .desc {
            font-size: 12px;
            color: var(--muted)
        }

/* primary big button full width */
.primary {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(180deg,var(--accent),var(--accent-600));
    color: white;
    font-weight: 700;
    font-size: 16px;
    border: none;
    box-shadow: 0 8px 28px rgba(11,106,98,0.12);
    cursor: pointer;
}

    .primary:active {
        transform: translateY(1px)
    }

.subtle {
    grid-column: 1 / -1;
    padding: 12px 14px;
    border-radius: 12px;
    background: transparent;
    border: 1px dashed rgba(15,23,42,0.06);
    color: var(--muted);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.meta {
    background: #fff;
    border-top: 1px solid #dadada;
    bottom: 0;
    font-size: 14px;
    font-weight: 500;
    padding: 15px 0;
    position: fixed;
    text-align: center;
    width: 100%;
    z-index: 999;
    left: 0px;
}

    .meta .small {
        font-size: 12px
    }
.maincard {
    padding: 0px !important;
    border-top: 1px solid #dadada; border-radius:0px;
}
/* Responsive tweaks */
@media (max-width:420px) {
    .brand {
        gap: 10px
    }

    .logo {
        width: 56px;
        height: 56px
    }

    .title h1 {
        font-size: 16px
    }

    .grid {
        gap: 10px
    }

    .action {
        padding: 12px;
        min-height: 58px
    }

    .primary {
        font-size: 15px
    }
}
/* SECTION HEADER */
.section-header {
    margin-bottom: 15px;
    padding: 0px 2px;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 4px;
    margin-top: 0px;
}

.section-sub {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

/* -------------------------
   Token result — beautiful UI
   (Drop into patientregistration.css)
   ------------------------- */

/* Card container */
#tokenResult .token-card{
  --card-bg: linear-gradient(180deg,#ffffff,#fbfcfd);
  --card-border: rgba(15,23,42,0.04);
  --muted-txt: #6b7280;
  --accent-strong: var(--accent-600, #0b6a62);
  --accent-soft: rgba(11,106,98,0.08);

  display: block;
  width: 100%;
  border-radius: 14px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(11,106,98,0.06);
  box-sizing: border-box;
  transition: transform .18s cubic-bezier(.2,.9,.2,1), box-shadow .18s;
  will-change: transform;
  overflow: hidden;
}

/* small pop when revealed */
#tokenResult .token-card.reveal{
  transform: translateY(-6px);
}

/* header: token number + meta */
.token-head {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    text-align: right;
}
.token-num{
  min-width:94px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:28px;
  padding:12px 18px;
  border-radius:12px;
  color:#fff;
  background: linear-gradient(180deg,var(--accent, #0f766e), var(--accent-600, #0b6a62));
  box-shadow: 0 8px 20px rgba(11,106,98,0.12), inset 0 -2px 6px rgba(0,0,0,0.06);
  letter-spacing: 0.6px;
  text-align:center;
}

/* meta date/time */
.token-meta { font-size:13px; color:var(--muted-txt,#6b7280); line-height:1.05; }
    .token-meta .meta-row strong {
        display: block;
        font-weight: 700;
        color: #0f172a;
        font-size: 14px;
        line-height: 18px;
    }

/* body blocks */
.token-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
    margin-top: 15px;
}

/* Doctor & Reception blocks */
.doctor-block, .reception-block{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px;
  border-radius:10px;
  background: linear-gradient(180deg, rgba(11,106,98,0.03), rgba(255,255,255,0.0));
  border: 1px solid rgba(11,106,98,0.05);
}

.doc-title { font-size:12px; color:var(--muted-txt,#6b7280); font-weight:700; text-transform:uppercase; letter-spacing:0.6px; }
.doc-name { font-weight:700; font-size:14px; color:var(--accent-strong,#0b6a62); }

/* countdown row */
.countdown-row{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding:6px 2px;
}

/* SVG ring */
.countdown-visual{
  width:92px;
  height:92px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.progress-ring{ transform: rotate(-90deg); width:92px; height:92px; display:block; }
.progress-bg{ stroke: var(--accent-soft, rgba(11,106,98,0.08)); stroke-width:10; }
.progress-fg{
  stroke: var(--accent-strong, #0b6a62);
  stroke-width:10;
  stroke-linecap: round;
  transition: stroke-dashoffset 240ms linear, stroke 200ms linear;
  filter: drop-shadow(0 6px 14px rgba(11,106,98,0.14));
}

/* inner numeric time badge centered (optional) — uses absolute positioning */
.countdown-visual::after{
  content: '';
  position: absolute;
  width: 56%;
  height: 56%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(11,106,98,0.03), rgba(255,255,255,0.0));
  left: 22%;
  top: 22%;
  z-index: 0;
  pointer-events: none;
}

/* countdown text */
.countdown-info{ flex:1; display:flex; flex-direction:column; gap:6px; justify-content:center; }
.time-label { font-size:12px; color:var(--muted-txt,#6b7280); font-weight:700; text-transform:uppercase; letter-spacing:0.6px; }
.time-value { font-size:28px; font-weight:900; color:var(--accent-strong,#0b6a62); letter-spacing:0.4px; }
.position { font-size:13px; color:var(--muted-txt,#6b7280); }

/* foot */
.token-foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:4px; }
.foot-left.small{ font-size:12px; color:var(--muted-txt,#6b7280); }
.foot-actions{ display:flex; gap:8px; align-items:center; }

/* buttons */
.small-btn{
  background: #fff;
  border: 1px solid rgba(15,23,42,0.06);
  padding:8px 10px;
  border-radius:10px;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(11,106,98,0.04);
}
.small-btn:active{ transform: translateY(1px); }

/* subtle close */
.subtle.small-btn{ background:transparent; border:1px solid rgba(15,23,42,0.04); color:var(--muted-txt,#6b7280); }

/* finished state — make ring pulse */
.token-card.finished .progress-fg {
  animation: pulseRing 1.6s ease-in-out infinite;
}
@keyframes pulseRing {
  0% { filter: drop-shadow(0 6px 14px rgba(11,106,98,0.18)); }
  50% { filter: drop-shadow(0 12px 28px rgba(11,106,98,0.26)); transform: scale(1.01); }
  100% { filter: drop-shadow(0 6px 14px rgba(11,106,98,0.18)); transform: scale(1); }
}

/* micro animation when token appears */
@keyframes popIn {
  from { transform: translateY(6px) scale(.995); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
#tokenResult .token-card{ animation: popIn .28s cubic-bezier(.2,.9,.2,1) both; }

/* responsive tweaks */
@media (max-width:420px){
  .token-head{ gap:10px; align-items:flex-start; }
  .token-num{ font-size:24px; padding:10px 14px; min-width:78px; }
  .countdown-visual{ width:76px; height:76px; }
  .progress-ring{ width:76px; height:76px; }
  .time-value{ font-size:22px; }
}

/* accessibility high-contrast fallback */
@media (prefers-contrast: more){
  .token-num{ box-shadow:none; }
  .progress-fg{ filter:none; stroke-width:12; }
}

/* small helper: hide token card gracefully */
#tokenResult[hidden], #tokenResult[style*="display: none"] {
  display: none !important;
}

/* Mobile: make grid actions true 50% tiles and center their content */
@media (max-width: 540px) {
    /* allow the page wrapper to use full screen width on small phones */
    .wrap {
        max-width: 100% !important;
        padding-left: 12px;
        padding-right: 12px;
    }
    .smallcard {
        padding: 18px 0px !important;
    }
    /* ensure grid columns take equal space and cannot shrink */
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
        width: 100%;
    }

        /* force each grid child tile to stretch to full column width */
        .grid > * {
            width: 100%;
            min-width: 0; /* important for overflowing content */
        }

    /* make actions visually balanced */
    .action {
        justify-content: center; /* center icon + text horizontally */
        text-align: center; /* center multi-line labels */
        padding: 12px 10px;
        gap: 8px;
    }
    .title p{
        margin-top:5px;
    }
    /* keep icon and text stacked / compact */
    .action svg {
        margin: 0;
        flex-shrink: 0;
    }

        /* force label to center and wrap nicely */
        .action .label {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

            /* allow long doctor names or descriptions to wrap instead of pushing layout */
            .action .label .name,
            .action .label .desc {
                white-space: normal;
               text-align: left;

            }

    /* make the primary (full-width) button still span both columns cleanly */
    .primary {
        grid-column: 1 / -1;
        width: 100%;
    }
}
