* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  color: #1C1F58;
  /* Full viewport multi-directional gradient */
  background: 
    /* Horizontal blue → green */
    linear-gradient(to right, #3b82f6 0%, #10b981 100%),
    /* Vertical fade to white/gray */
    linear-gradient(to bottom, rgba(255,255,255,0) 0%, #f4f6f8 100%);
  
  background-repeat: no-repeat;
  background-size: 100% 100%; /* cover full width and height of viewport */
  background-blend-mode: overlay; /* smooth combination of both layers */
}

.card {
  background: white;
  margin: auto;
  padding: 24px;
  border-radius: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

h2 {
  margin-bottom: 24px;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 24px;
  font-size: 16px;
}

input,
select {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border-radius: 36px;
  border: 1px solid #ccc;
  font-size: 18px;
}

select {
  appearance: none;
  background: white 
              url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 2'><path fill='gray' d='M0 0 L4 0 L2 2 Z'/></svg>") 
              no-repeat 
              right 10px center;
  background-size: 8px 10px;
}



input:focus, select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: 36px;
  border: none;
  background: #393DA4;
  color: white;
  font-size: 16px;
  cursor: pointer;
  height: 48px;
}

button:active {
  transform: scale(0.98);
}

button:hover {
  background: #545AFE;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

.card {
  transition: opacity 0.2s ease;
}

/* Toggle wrapper */
.category-toggle-wrapper {
  display: block;          /* block-level helps iOS detect swipes */
  touch-action: pan-y;     /* vertical scrolling still works */
  -webkit-user-select: none;
  margin-bottom: 24px;
}

/* Toggle container */
.category-toggle {
  position: relative;
  margin: 0 auto;
  display: flex;
  background: #e9ecef;
  border-radius: 999px;
  padding: 4px;
  width: 240px;
  user-select: none;
}

/* Sliding pill */
.toggle-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 8px);
  height: calc(100% - 8px);
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
  z-index: 1;
  /* to force hardware acceleration */
  transform: translateX(0) translateZ(0);
  will-change: transform;
}

/* Fully reset toggle buttons */
.category-toggle button {
  all: unset;             /* remove all global button styles */
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  user-select: none;
  z-index: 2;
  text-align: center;
  pointer-events: auto;                     /* ensure clicks work */
  border-radius: 999px;                     /* optional for pill look */
  height: 36px;                             /* fix vertical alignment */
  -webkit-tap-highlight-color: transparent; /* remove blue tap highlight */
  touch-action: manipulation;               /* improves tap responsiveness */
}
  
/* Active state */
.toggle-option.active {
  color: #111;
}

.toggle-option:focus-visible {
  outline: 2px solid #4c6ef5;
  outline-offset: 2px;
}


/* Login Model */
/* Modal overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(28, 31, 88, 0.8);
  /* semi-transparent dark */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* Modal content box */
.modal-content {
  background: white;
  padding: 32px;
  border-radius: 36px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.modal input {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  border-radius: 36px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.modal button {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border-radius: 36px;
  border: none;
  background: #393DA4;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.modal button:hover {
  background: #545AFE;
}

.modal p {
  margin-top: 12px;
  color: red;
}

.logout-btn {
  all: unset;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  color: #6b7280;
  /* muted gray */
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  -webkit-tap-highlight-color: transparent; /* remove tap highlight on iOS/Android */
  touch-action: manipulation;               /* improve touch behavior */
  transform: translateX(-50%) translateZ(0); /* force hardware acceleration */
}

.logout-btn:hover {
  background: none;
  color: #111827;
  text-decoration: underline;
}

.logout-btn:active {
  transform: translateX(-50%) translateZ(0); /* prevent movement on press */
}

.logout-btn.hidden {
  display: none;
}

/* Fade utility classes */
.fade {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  /* disable interaction while hidden */
}

.fade.show {
  opacity: 1;
  pointer-events: auto;
}