/* 1ERP Backend HTML Template CSS (Standalone vanilla CSS) */
:root {
  --bg-color: #f4f4f5;
  --card-bg: #ffffff;
  --text-color: #18181b;
  --text-muted: #71717a;
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-text: #ffffff;
  --border-color: #e4e4e7;
  --radius: 0.75rem;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #09090b;
    --card-bg: #18181b;
    --text-color: #f4f4f5;
    --text-muted: #a1a1aa;
    --border-color: #27272a;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header & Footer */
header.navbar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-1 { flex: 1; }
.flex-none { flex: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }

@media (min-width: 640px) {
  .sm\:w-14 { width: 3.5rem; }
  .sm\:h-14 { height: 3.5rem; }
  .sm\:w-16 { width: 4rem; }
  .sm\:h-16 { height: 4rem; }
  .sm\:gap-6 { gap: 1.5rem; }
}
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

footer.footer {
  padding: 1.5rem;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Containers & Cards */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.max-w-md { max-width: 28rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Typography & Badges */
h1 { font-weight: 900; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-lg { font-size: 1.125rem; }
.text-base { font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.tracking-tight { letter-spacing: -0.025em; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background-color: var(--primary-color);
  color: var(--primary-text);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-color);
  padding: 0.375rem 0.75rem;
}
.btn-ghost:hover {
  background-color: rgba(127, 127, 127, 0.1);
}
.btn-sm { font-size: 0.75rem; padding: 0.375rem 0.75rem; }
.btn-md { font-size: 0.875rem; padding: 0.625rem 1.25rem; }
.btn-lg { font-size: 1rem; padding: 0.75rem 2rem; border-radius: 0.625rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.375rem 0.75rem;
}
.btn-outline:hover {
  background-color: rgba(127, 127, 127, 0.08);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(127, 127, 127, 0.1);
  color: var(--text-muted);
}
.badge-outline {
  background: transparent;
  border: 1px solid var(--border-color);
}
.hidden { display: none !important; }
.text-error { color: #ef4444; }
.text-primary { color: var(--primary-color); }
.border-base-200 { border-color: var(--border-color); }
.border-base-300 { border-color: var(--border-color); }
.bg-base-100 { background-color: var(--card-bg); }
.bg-base-200 { background-color: var(--bg-color); }
.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
  margin-right: 0.75rem;
}

.divider:not(:empty)::after {
  margin-left: 0.75rem;
}

.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: var(--card-bg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: rgba(127, 127, 127, 0.06);
  border-right: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.input-group .input {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.input-group .input:focus {
  border: none;
  box-shadow: none;
}

.otp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 0.625rem 0.75rem;
  padding-left: 1.125em; /* balances trailing letter-spacing */
}

.link {
  color: var(--primary-color);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: text-bottom;
}

/* Auth Card & Buttons UI Enhancements */
.auth-wrapper {
  position: relative;
  width: 100%;
  max-width: 26rem;
  z-index: 1;
}

.auth-bg-ambient {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -15%);
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.14) 0%, rgba(99, 102, 241, 0.06) 45%, transparent 70%);
  filter: blur(45px);
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  background-color: var(--card-bg);
  border: 1px solid rgba(228, 228, 231, 0.85);
  border-radius: 1.125rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.07), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .auth-card {
    border-color: rgba(39, 39, 42, 0.9);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  }
}

.btn-otp-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.32);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  width: 100%;
}

.btn-otp-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.42);
  transform: translateY(-1.5px);
}

.btn-otp-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px 0 rgba(79, 70, 229, 0.25);
}

.btn-google {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  width: 100%;
}

.btn-google:hover {
  background-color: rgba(127, 127, 127, 0.04);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-1.5px);
}

@media (prefers-color-scheme: dark) {
  .btn-google:hover {
    border-color: #3f3f46;
    background-color: rgba(255, 255, 255, 0.03);
  }
}

.btn-google:active {
  transform: translateY(0);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  background-color: rgba(79, 70, 229, 0.08);
  color: var(--primary-color);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 0.5rem;
}

