@import './shared.css';

html,
body {
  height: 100%;
  margin: 0;
  display: flex;
  justify-content: center;
  /* horizontal center */
  align-items: center;
  /* vertical center */
  /* background: radial-gradient(1200px 800px at 80% -20%, #1a1f2e 0%, #111318 45%, #0f1115 70%); */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}


#title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 12px;
}

#title,
.brand {
  text-align: center;
  /* center all text */
}

p {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

p #count {
  font-weight: 700;
  color: var(--primary);
  /* highlight the count */
}


.card {
  max-width: 420px;
  width: 100%;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .02));
}

.field {
  margin: 12px 0;
}

.label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f121a;
  color: var(--text);
}

.input:focus {
  border-color: rgba(79, 140, 255, .6);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, .14);
}

.inputpin {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f121a;
  color: var(--text);
  text-align: center;
}

.inputpin:focus {
  border-color: rgba(79, 140, 255, .6);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, .14);
}

.password-wrap {
  position: relative;
}

.toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.btn {
  margin-top: 10px;
}

.error {
  display: none;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #5d1c1c;
  background: rgba(255, 0, 0, .06);
  color: #f3caca;
  border-radius: 10px;
  font-size: 14px;
}

.ok {
  display: none;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid green;
  background: rgba(0, 255, 0, .06);
  color: #c3f3c3;
  border-radius: 10px;
  font-size: 14px;
}

.footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.link {
  color: var(--text);
  text-decoration: underline;
}

button[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* ================================
   THEME TOGGLE SWITCH – Moon ↔ Sun
   ================================ */

.theme-toggle-field {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.theme-toggle-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.theme-toggle-text {
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity 0.2s ease, font-weight 0.2s ease, color 0.2s ease;
}

.theme-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-slider {
  position: relative;
  width: 72px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(145deg, #1e293b, #1e293b); /* deep blue-gray */
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.4),
    0 10px 25px rgba(148, 163, 184, 0.4);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Knob (moon/sun) */
.theme-toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6a7ec1 20%, #445979 100%);
  box-shadow:
    inset -4px -4px 8px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(15, 23, 42, 0.6);
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.5s ease,
    box-shadow 0.5s ease;
}

/* === DARK MODE (checked, default) === */
.theme-toggle-input:checked + .theme-toggle-slider {
  background: linear-gradient(145deg, #0f172a, #1e293b);
}

.theme-toggle-input:checked + .theme-toggle-slider::before {
  transform: translateX(0);
  background: radial-gradient(circle at 40% 40%, #e0e7ff 20%, #94a3b8 100%);
  box-shadow:
    inset -4px -4px 8px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(15, 23, 42, 0.6);
}

.theme-toggle-input:checked ~ .theme-toggle-text--dark {
  opacity: 1;
  font-weight: 600;
  color: #f8fafc;
}

/* === LIGHT MODE (unchecked = sun) === */
.theme-toggle-input:not(:checked) + .theme-toggle-slider {
  background: linear-gradient(145deg, #777, #777); /* soft sunrise gradient */
  box-shadow:
    inset 0 0 0 1px rgba(234, 179, 8, 0.3),
    0 8px 18px rgba(234, 179, 8, 0.4);
}

.theme-toggle-input:not(:checked) + .theme-toggle-slider::before {
  transform: translateX(40px);
  background: radial-gradient(circle at 40% 40%, #ebb71e 10%, #facc15 90%);
  box-shadow:
    inset -2px -2px 6px rgba(255, 255, 255, 0.6),
    0 4px 8px rgba(234, 179, 8, 0.6);
}

.theme-toggle-input:not(:checked) ~ .theme-toggle-text--light {
  opacity: 1;
  font-weight: 600;
  color: #e7d513; /* warm golden text */
}


/* LIGHT MODE THEME */
body.light-mode {
  --background: #f8fafc;
  --text: #111827;
  --muted: #4b5563;
  --border: #d1d5db;
  --primary: #0C704F; /* brand green */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
}

body.light-mode .card {
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

body.light-mode .input {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

body.light-mode .label {
  color: #4b5563;
}

body.light-mode .link {
  color: #0C704F;
}

body.light-mode .btn {
  background-color: #0C704F; /* brand green */
  color: #ffffff;
  border: none;
  padding: 12px 14px;
  /* font-size: 1rem; */
  border-radius: var(--radius);
  cursor: pointer;
}

body.light-mode .btn:hover {
  background-color: #095c3f; /* hover darker green */
}

