/* ==========================================================================
   Shree Ram Collection — Billing Login (Light Theme)
   Palette drawn from the shop's own signboard:
   yellow panel, deep red 3D letters, blue tagline, charcoal base strip
   ========================================================================== */

:root {
  --yellow:        #efb219;
  --yellow-dark:   #d99c0a;
  --yellow-deep:   #b97e05;

  --red:           #b5312a;
  --red-light:     #d1493f;
  --red-shadow:    #6e1712;

  --blue:          #1c3b6e;
  --blue-light:    #2b4f8f;

  --charcoal:      #221a14;
  --charcoal-soft: #3a2c22;

  /* Card is a touch lighter/warmer than the page behind it, so it still
     stands out without ever going stark white */
  --cream:         #fffdf8;
  --cream-dark:    #ece3cd;

  --gold-bead:     #c99a2e;

  /* Page background: light neutral warm-grey, NOT pure white */
  --page-bg-1:     #f4f1ea;
  --page-bg-2:     #ece6d8;
  --page-bg-3:     #e4dcc7;

  --text-muted:    #6b6255;

  --font-display: 'Baloo 2', 'Noto Sans Devanagari', sans-serif;
  --font-body:    'Poppins', sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* accounts for mobile browser UI chrome */
  font-family: var(--font-body);
  color: var(--charcoal);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.9), transparent 45%),
    linear-gradient(160deg, var(--page-bg-1) 0%, var(--page-bg-2) 55%, var(--page-bg-3) 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vw, 40px) clamp(12px, 4vw, 24px);
}

.page {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Hanging bead string (echoes the wire of beads across the board) ---------- */

.bead-string {
  width: 100%;
  max-width: 340px;
  position: relative;
  height: 34px;
  margin-bottom: -6px;
  z-index: 2;
}

.bead-string svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.bead-string svg path {
  stroke: #a9863c;
}

.beads {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.beads span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f0cf6f, var(--gold-bead) 70%, #7a5a1e 100%);
  align-self: flex-end;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  animation: sway 3.2s ease-in-out infinite;
}
.beads span:nth-child(odd)  { animation-delay: -0.4s; }
.beads span:nth-child(3n)   { animation-delay: -1.1s; }
.beads span:nth-child(5n)   { transform: translateY(6px); }
.beads span:nth-child(4n)   { transform: translateY(10px); }

@keyframes sway {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .beads span { animation: none; }
}

/* ---------- Signboard ---------- */

.board-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.signboard {
  position: relative;
  width: 100%;
  max-width: 340px;
  background:
    linear-gradient(155deg, var(--yellow) 0%, var(--yellow-dark) 55%, var(--yellow-deep) 100%);
  border-radius: 10px;
  padding: clamp(22px, 6vw, 30px) clamp(14px, 5vw, 20px) 18px;
  text-align: center;
  box-shadow:
    0 10px 0 -6px rgba(0,0,0,0.12),
    0 16px 26px rgba(140,110,40,0.22);
  transform: rotate(-0.6deg);
}

.board-base {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -10px;
  height: 10px;
  background: var(--charcoal);
  border-radius: 0 0 6px 6px;
}

.bolt {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8e8e8, #8a8a8a 60%, #4a4a4a 100%);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.5);
}
.bolt-tl { top: 10px; left: 10px; }
.bolt-tr { top: 10px; right: 10px; }
.bolt-bl { bottom: 22px; left: 10px; }
.bolt-br { bottom: 22px; right: 10px; }

/* ---------- Shop logo ---------- */

.shop-logo {
  display: block;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 260px;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.shop-name {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 9vw, 3rem);
  line-height: 1;
  color: var(--red);
  letter-spacing: 1px;
  text-shadow:
    2px 2px 0 var(--red-shadow),
    4px 4px 0 var(--red-shadow),
    5px 6px 8px rgba(0,0,0,0.2);
}

.shop-tagline {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  color: var(--blue);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.shop-sub {
  margin: 2px 0 12px;
  font-size: clamp(0.58rem, 2vw, 0.65rem);
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--charcoal-soft);
}

/* ---------- Login card ---------- */

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  margin-top: 26px;
  padding: clamp(20px, 5vw, 26px) clamp(16px, 5vw, 24px) 24px;
  box-shadow: 0 14px 28px rgba(90,70,30,0.14);
}

.login-card h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--charcoal);
}

.login-hint {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--charcoal-soft);
}

.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 16px; /* 16px minimum keeps iOS Safari from auto-zooming on focus */
  border: 1.5px solid #ddd0aa;
  border-radius: 8px;
  background: #fffefb;
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field input::placeholder {
  color: #9c9384;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(28, 59, 110, 0.15);
}

.field input.input-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 49, 42, 0.15);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 42px;
}

.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #a0906b;
  padding: 6px;
  display: flex;
  border-radius: 6px;
}

.toggle-password:hover,
.toggle-password:focus-visible {
  color: var(--blue);
  outline: none;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--charcoal-soft);
  cursor: pointer;
}

.remember input {
  accent-color: var(--red);
  width: 15px;
  height: 15px;
}

.form-message {
  min-height: 20px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--red);
}

.form-message.success {
  color: #2b7a3f;
}

.login-btn {
  width: 100%;
  padding: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.5px;
  color: var(--cream);
  background: linear-gradient(160deg, var(--red-light), var(--red) 60%, var(--red-shadow));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(181, 49, 42, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(181, 49, 42, 0.38);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-btn:focus-visible,
.field input:focus-visible,
.remember input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- Footer ---------- */

.page-footer {
  margin-top: 22px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 340px) {
  .signboard { padding: 20px 12px 16px; }
  .login-card { padding: 18px 14px 18px; }
  .field { margin-bottom: 12px; }
  .shop-logo { max-width: 180px; max-height: 90px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  body { padding: 12px; align-items: flex-start; }
  .bead-string { display: none; }
  .signboard { padding: 14px 20px 10px; }
  .shop-logo { max-width: 140px; max-height: 60px; margin-bottom: 6px; }
  .shop-name { font-size: 1.8rem; }
  .shop-tagline { font-size: 1rem; margin-bottom: 0; }
  .shop-sub { display: none; }
  .login-card { margin-top: 14px; padding: 16px 20px; }
  .field { margin-bottom: 10px; }
}

@media (min-width: 600px) {
  .page { max-width: 400px; }
  .bead-string { max-width: 360px; }
  .signboard, .login-card { max-width: 360px; }
}

@media (min-width: 1024px) {
  .page { max-width: 420px; }
  .bead-string { max-width: 380px; }
  .signboard, .login-card { max-width: 380px; }
  .login-card:hover { box-shadow: 0 18px 36px rgba(90,70,30,0.18); }
}

@media (min-width: 1600px) {
  .page { max-width: 460px; }
  .bead-string { max-width: 400px; }
  .signboard, .login-card { max-width: 400px; }
}