@import './shared.css';

/* ======================================
   FLOATING DOCK IMPORT
   ====================================== */
.dock {
  position: fixed;
  top: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  z-index: 100;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, border-radius 0.3s;
}

.dock.collapsed {
  transform: translate(-50%, -120%);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}

/* Create a permanent toggle hit area that stays visible */
.dock.collapsed .dock-toggle {
  position: fixed;
  top: 120%; /* Pushes it back into view */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 1; /* Keep fully visible when collapsed */
}

.dock.collapsed .dock-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-50%) scale(1.1);
}

.dock.collapsed .dock-toggle .dl {
  display: none; /* Hide the text "Show" on the circular button */
}

/* Ensure other icons hide when collapsed */
.dock.collapsed .di:not(.dock-toggle), 
.dock.collapsed .dock-sep2 {
  opacity: 0;
  pointer-events: none;
}

.dock-sep2 {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.25rem;
}

.di {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  position: relative;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.di .dl {
  font-size: 0.46rem;
  font-family: monospace;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s;
}

.di:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-7px) scale(1.1);
}

.di:hover .dl {
  opacity: 1;
}

.di.act {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.di.act::after {
  content: '';
  position: absolute;
  bottom: -8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

/* Light mode overrides for dock */
html.light-mode .dock {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

html.light-mode .dock-sep2 {
  background: rgba(0, 0, 0, 0.1);
}

html.light-mode .di {
  color: rgba(0, 0, 0, 0.45);
}

html.light-mode .di:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.08);
}

html.light-mode .di.act {
  color: #000;
  background: rgba(0, 0, 0, 0.1);
}

html.light-mode .di.act::after {
  background: rgba(0, 0, 0, 0.65);
}

html,
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

@media (max-height: 800px) {
  body {
    align-items: flex-start;
  }
}

#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 {
  min-width: 480px;
  max-width: 860px;
  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));
  margin-top: 5rem;
  margin-bottom: 2rem;
}

/* Two-column grid ONLY for signup forms (with many fields) */
#signupForm {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

/* Full-width fields that span both columns */
#signupForm .field:first-child,
#signupForm .field:nth-child(2),
#signupForm .field.password-wrap,
#signupForm button[type="submit"],
#signupForm .error,
#signupForm .ok {
  grid-column: 1 / -1;
}

/* Regular fields take up one column each */
.field {
  margin: 0;
}

/* Responsive: single column on smaller screens */
@media (max-width: 768px) {
  .card {
    min-width: unset;
    max-width: 100%;
  }

  #signupForm {
    grid-template-columns: 1fr;
  }

  #signupForm .field:first-child,
  #signupForm .field:nth-child(2),
  #signupForm .field.password-wrap,
  #signupForm button[type="submit"],
  #signupForm .error,
  #signupForm .ok {
    grid-column: 1;
  }
}

/* Fallback spacing for non-signup forms */
form:not(#signupForm) .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%;
  margin-top: 15px;
  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:not(.msg) {
  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:not(.msg) {
  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 */
html.light-mode {
  --background: #f8fafc;
  --text: #111827;
  --muted: #4b5563;
  --border: #d1d5db;
  --primary: var(--premium-color-1);
  /* brand green */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
}

html.light-mode .card {
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

html.light-mode .input {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

html.light-mode .label {
  color: #4b5563;
}

html.light-mode .link {
  color: var(--premium-color-1);
}

html.light-mode .btn {
  background-color: var(--premium-color-1);
  /* brand green */
  color: #ffffff;
  border: none;
  padding: 12px 14px;
  /* font-size: 1rem; */
  border-radius: var(--radius);
  cursor: pointer;
}

html.light-mode .btn:hover {
  background-color: var(--premium-color-3);
  /* hover darker green */
}



/* Clean small hint icon */
.hint {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.hint i {
  font-size: 14px;
  color: var(--muted);
}

/* Tooltip styling */
.hint[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -38px;
  /* left: 0; */
  width: max-content;
  max-width: 220px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* Show tooltip on hover */
.hint:hover::after {
  opacity: 1;
}

/* Light mode adjustment */
html.light-mode .hint i {
  color: #6b7280;
  /* soft gray */
}

html.light-mode .hint[data-tooltip]::after {
  background: rgba(50, 50, 50, 0.9);
  color: #fff;
}

@media (max-width: 480px) {
  .hint[data-tooltip]::after {
    right: 0;
  }

}

.reset-card {
  width: 360px;
}

