/* Modern, mobile-first styling for Number Aacharya */
:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #68707a;
  --accent: #2b7a4b;
  --accent-2: #f6b042;
  --danger: #e14b4b;
  --radius: 12px;
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; background:linear-gradient(180deg,#eef3f8 0%,var(--bg) 100%); color:#111}

.page-wrap{max-width:1100px;margin:20px auto;padding:16px}
.header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.brand{display:flex;align-items:center;gap:12px}
.brand-logo{width:110px;height:auto;border-radius:8px;box-shadow:0 6px 18px rgba(15,23,42,0.06)}
.app-title{margin:0;font-size:1.5rem;color:green}
.subtitle{margin:0;font-size:0.9rem;color:var(--muted)}
.header-actions{display:flex;gap:8px;align-items:center}

.card{background:var(--card);border-radius:var(--radius);padding:16px;box-shadow:0 6px 20px rgba(16,24,40,0.06);margin-bottom:16px}
.card-title{margin:0 0 10px 0;font-size:1.1rem}

.user-card .user-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.phone-steps .steps-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.step{background:#f8fafc;padding:8px 12px;border-radius:10px;border:1px solid rgba(15,23,42,0.04);font-weight:600}
.chev{color:var(--muted);margin:0 6px}

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

.quick-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.num-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 12px;
  border-radius: 10px;
  min-height: 84px;      
}
.num-block .label { margin-bottom: 6px; }
.num-block .num-value { margin-bottom: 8px; }

.number-note {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
  background: rgba(15,23,42,0.02);
  padding: 6px 8px;
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 720px) {
  .quick-numbers { grid-template-columns: repeat(2, 1fr); }
}

.label{font-size:0.85rem;color:var(--muted)}
.muted{color:var(--muted)}

.recommendation.highlight-strong{border-left:4px solid var(--accent)}
.status.good{color:var(--accent);font-weight:700}
.status.warn{color:var(--accent-2);font-weight:700}
.issues ul{margin:8px 0 0 18px}

.grid-wrap{display:flex;flex-direction:column;gap:12px}
.num-grid{border-collapse:collapse;width:100%;max-width:420px}
.num-grid td{width:56px;height:56px;text-align:center;font-weight:700;border-radius:8px;border:1px solid rgba(15,23,42,0.16);background:#fbfdff}
.missing-number{color:#9aa3b2;background:linear-gradient(180deg,#fff,#f6f9fc)}
.grid-analysis{background:linear-gradient(90deg, rgba(246,176,66,0.15), rgba(255,255,255,0.02));padding:12px;border-radius:8px}
.tip{font-size:0.9rem;color:var(--muted);margin:6px 0}

.pairs-grid{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.pair-item{min-width:110px;max-width:160px;padding:10px;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;box-shadow:0 4px 10px rgba(12,18,25,0.04)}
.pair-item .pair-number{font-weight:800;font-size:1.1rem}
.pair-item.good{background:rgba(43,122,75,0.50);border:1px solid rgba(43,122,75,0.60)}
.pair-item.neutral{background:rgba(246,182,56,0.50);border:1px solid rgba(246,182,56,0.60)}
.pair-item.bad{background:rgba(225,75,75,0.50);border:1px solid rgba(225,75,75,0.60)}

.pairs-details{margin-top:12px}
.pairs-details h4{margin:6px 0}
.pairs-details ul{margin:6px 0 0 18px}

/* Pair reason groups */
/* .pair-details.group-good {
  background: rgba(43,122,75,0.50);
  border: 1px solid rgba(43,122,75,0.60);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.pair-details.group-neutral {
  background: rgba(246,182,56,0.50);
  border: 1px solid rgba(246,182,56,0.60);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.pair-details.group-bad {
  background: rgba(225,75,75,0.50);
  border: 1px solid rgba(225,75,75,0.60);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
} */

/* Pair reason groups styled like recommendation */
.pair-details {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(16,24,40,0.06);
  padding: 12px 16px;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
}

.pair-details.group-good {
  border-left-color: var(--accent);   /* green */
}

.pair-details.group-neutral {
  border-left-color: var(--accent-2); /* amber */
}

.pair-details.group-bad {
  border-left-color: var(--danger);   /* red */
}

.pair-details h4 {
  margin: 0 0 6px 0;
}

.pair-details ul {
  margin: 8px 0 0 18px;
}

.legend{font-size:0.9rem;color:var(--muted)}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px}
.good-dot{background:var(--accent)}
.neutral-dot{background:var(--accent-2)}
.bad-dot{background:var(--danger)}

.footer{display:flex;justify-content:space-between;align-items:center;gap:12px}
.footer .meta{color:var(--muted)}
.btn{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:10px;border:none;background:#f3f6f9;cursor:pointer}
.btn.logout{background:var(--danger);color:white}
.icon-btn img{width:22px;height:auto}

@media (max-width:720px){
  .user-grid{grid-template-columns:1fr}
  .quick-numbers{grid-template-columns:1fr 1fr}
  .num-grid td{width:44px;height:44px}
  .page-wrap{padding:12px}
}

@media (max-width:420px){
  .quick-numbers{grid-template-columns:1fr}
  .brand-logo{width:78px}
  .app-title{font-size:1.1rem}
}

/* Login page style starts here */

/* Login page styles */
.login-card {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input {
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,0.1);
  border-radius: 8px;
  font-size: 1rem;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(43,122,75,0.2);
}

.login-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  justify-content: center;
}

.login-btn:hover {
  background: #25633d;
}

/* Login page style ends here */


/* index page styles starts here */

/* Index (user input) page styles */
.input-card {
  max-width: 520px;
  margin: 40px auto;
}

.input-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  text-align: center;
}

.input-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.submit-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  justify-content: center;
}

.submit-btn:hover {
  background: #25633d;
}

.logout {
  background: var(--danger);
  color: #fff;
  justify-content: center;
}

.logout:hover {
  background: #b93838;
}


/* index page styles ends here */

/* personalised suggestion style starts here */

/* Suggestions card */
.suggestions-card { padding-bottom: 8px; }

/* Grid for suggestion items */
.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.suggestion-item {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(16,24,40,0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 84px;
  align-items: flex-start;
}

.suggestion-head {
  font-size: 0.9rem;
  color: var(--muted);
}

.suggestion-body {
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
}

.suggestion-meta strong { display:block; font-weight:700; color:#0f1724; }
.suggestion-meta .small { font-size:0.85rem; color:var(--muted); margin-top:4px; }

/* Responsive */
@media (max-width:720px) {
  .suggestions-grid { grid-template-columns: 1fr; }
}


/* personalised suggestion style ends ere */

/* Header layout for input page */
.page-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

/* Unobtrusive logout link in header */
.logout-link {
  font-size:0.95rem;
  color:var(--muted);
  text-decoration: none;
  padding:8px 10px;
  border-radius:8px;
  transition:background .15s, color .15s;
}

.logout-link:hover,
.logout-link:focus {
  background: rgba(15,23,42,0.04);
  color: #0f1724;
  outline: none;
  box-shadow: 0 0 0 3px rgba(43,122,75,0.06);
}

/* On small screens keep it subtle */
@media (max-width:420px){
  .logout-link { padding:6px 8px; font-size:0.9rem; }
}

.warning {color:#b71c1c; font-weight:500;}

/* phone title display */
.phone-display { font-weight: 600; letter-spacing: 0.2px; }

/* highlighted second digit */
.phone-highlight {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 8px;
  margin: 0 4px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(43,122,75,0.12);
  display: inline-block;
  vertical-align: middle;
}

/* responsive tweak */
@media (max-width: 520px) {
  .phone-highlight { padding: 1px 6px; border-radius: 6px; }
}

/* Fail page styles starts here */

/* fail page styles (add to end of main stylesheet) */
.fail-card {
  max-width: 920px;
  margin: 36px auto;
  padding: 20px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(16,24,40,0.06);
  color: var(--text);
}

.fail-header {
  display:flex;
  gap:14px;
  align-items:center;
  margin-bottom: 12px;
}

.fail-header .brand-logo {
  width:92px;
  height:auto;
  border-radius:8px;
  object-fit:contain;
}

.fail-title-wrap .card-title {
  margin:0;
  font-size:1.25rem;
  line-height:1.2;
}

.fail-body { padding-top:8px; }

.fail-message { font-size:1rem; margin:10px 0; color:var(--text); }

.error-details {
  background: rgba(15,23,42,0.03);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  overflow-x: auto;
  max-height: 240px;
  border: 1px solid rgba(15,23,42,0.04);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size:0.9rem;
  color: var(--muted);
}

/* Actions row */
.fail-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
  align-items:center;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight:600;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(15,23,42,0.06);
  padding: 9px 12px;
  color: var(--text);
  border-radius: 10px;
  text-decoration: none;
  display:inline-flex;
  align-items:center;
}

.btn.link {
  background: transparent;
  border: none;
  padding: 8px;
  color: var(--muted);
  text-decoration: underline;
}

/* small helper */
.small { font-size:0.9rem; }

/* responsive */
@media (max-width:720px) {
  .fail-card { margin: 18px; padding:16px; }
  .fail-header .brand-logo { width:72px; }
  .fail-title-wrap .card-title { font-size:1.05rem; }
  .fail-actions { gap:8px; }
}

/* fail page style ends here */

/* Watermark background for success page */
/* ========== Watermark inside each card on success page ========== */
.success-page .card {
  position: relative;
  overflow: hidden; /* ensures watermark stays clipped inside the card */
}

/* Add a faint logo watermark centered inside every card */
.success-page .card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;   /* adjust size to taste */
  height: 240px;
  background: url('/images/na-logo.png') center center no-repeat;
  background-size: contain;
  opacity: 0.08;  /* transparency — increase to 0.08 or 0.1 if you want it slightly more visible */
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.success-page .pair-details::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;   /* adjust size to taste */
  height: 240px;
  background: url('/images/na-logo.png') center center no-repeat;
  background-size: contain;
  opacity: 0.08;  /* transparency — increase to 0.08 or 0.1 if you want it slightly more visible */
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Keep your text above the watermark */
.success-page .card > * {
  position: relative;
  z-index: 1;
}

