@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --background: 0 0% 98%;
  --foreground: 0 0% 12%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 12%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 12%;
  --primary: 358 82% 44%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 95%;
  --secondary-foreground: 0 0% 12%;
  --muted: 0 0% 94%;
  --muted-foreground: 0 0% 45%;
  --accent: 358 82% 96%;
  --accent-foreground: 358 82% 44%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 0 0% 90%;
  --input: 0 0% 86%;
  --ring: 358 82% 44%;
  --radius: 0.625rem;
  --success: 142 76% 36%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 0 0% 100%;
}

* {
  border-color: hsl(var(--border));
}

html, body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-in    { animation: fade-in 0.4s ease-out forwards; }
.animate-pulse-ring { animation: pulse-ring 1.5s ease-out infinite; }
.animate-spin       { animation: spin 1s linear infinite; }

/* Custom focus ring on form controls (Tailwind play-cdn lacks ring plugin nuances) */
.input-base,
.select-base,
.textarea-base {
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--card));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-base:focus,
.select-base:focus,
.textarea-base:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsla(var(--ring), 0.18);
}
.input-base:disabled,
.select-base:disabled,
.textarea-base:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: calc(var(--radius) - 2px);
  transition: all 0.15s;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary  { background-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-outline  { background-color: hsl(var(--card)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.btn-ghost    { background: transparent; color: hsl(var(--foreground)); }
.btn-sm  { height: 2.25rem; padding: 0 0.75rem; font-size: 0.875rem; }
.btn-md  { height: 2.5rem;  padding: 0 1rem;    font-size: 0.875rem; }
.btn-lg  { height: 2.75rem; padding: 0 1.5rem;  font-size: 0.9375rem; }
.btn-xl  { height: 3rem;    padding: 0 1.5rem;  font-size: 1rem; }

/* Card */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

/* Checkbox baseline */
.chk {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem; height: 1rem;
  border: 1px solid hsl(var(--input));
  border-radius: 0.25rem;
  background: hsl(var(--card));
  cursor: pointer;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.chk:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.chk:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid hsl(var(--primary-foreground));
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* OTP slot styling */
.otp-slot {
  width: 2.75rem;
  height: 2.75rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  caret-color: hsl(var(--ring));
}
.otp-slot:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsla(var(--ring), 0.18);
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  font-size: 0.875rem;
  line-height: 1.25rem;
  animation: fade-in 0.25s ease-out forwards;
}
.toast.success { border-left: 3px solid hsl(var(--success)); }
.toast.error   { border-left: 3px solid hsl(var(--destructive)); }
.toast.info    { border-left: 3px solid hsl(var(--primary)); }

/* Tabs (simple) */
.tab-list {
  display: flex;
  background: hsl(var(--muted));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem;
  gap: 0.25rem;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  color: hsl(var(--muted-foreground));
}
.tab-btn[aria-selected="true"] {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
