/* /assets/css/front.css
   AdvancingBud public/front-of-site shared layer
   Used by landing, auth, legal, contact, and lightweight transition pages.
   Keep dashboard/backoffice modules in backoffice.css and portal modules in portal.css.
   ========================================================================== */

/* ==========================================================================
   1. TOKENS & THEME
   ========================================================================== */
:root {
  --bg: #f8f9fc;
  --bg-accent: #ffffff;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-glass: rgba(255, 255, 255, 0.65);
  --surface-strong: #ffffff;
  --surface-2: #f1f5f9;

  --text: #475569;
  --text-strong: #0f172a;
  --muted: #475569;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --brand: #6b1a1a;
  --brand-600: #8a1f1f;
  --brand-700: #500106;
  --brand-glow: rgba(107, 26, 26, 0.15);
  --brand-contrast: #ffffff;

  --accent: #f1f1f1;
  --accent-strong: #e2e2e2;
  --accent-red: #a52525;
  --accent-red-strong: #8a1f1f;
  --danger: #a52525;
  --success: #15803d;

  --divider: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);

  --radius: 12px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 20px rgba(0, 0, 0, 0.02);

  --gradient-body: radial-gradient(circle at 50% 0%, rgba(107, 26, 26, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(200, 200, 255, 0.05) 0%, transparent 50%);
  --gradient-hero: radial-gradient(circle at 50% 0%, rgba(107, 26, 26, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(200, 200, 255, 0.05) 0%, transparent 50%);
}

.theme-dark {
  --bg: #050505;
  --bg-accent: #0e0e11;
  --surface: rgba(20, 20, 23, 0.6);
  --surface-glass: rgba(20, 20, 23, 0.7);
  --surface-strong: #18181b;
  --surface-2: #27272a;

  --text: #94a3b8;
  --text-strong: #ffffff;
  --muted: #64748b;

  --brand: #902828;
  --brand-600: #991b1b;
  --brand-700: #450a0a;
  --brand-glow: rgba(144, 40, 40, 0.25);

  --accent: #27272a;
  --accent-strong: #3f3f46;
  --accent-red: #ef4444;
  --accent-red-strong: #f87171;
  --danger: #ef4444;
  --success: #22c55e;

  --divider: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

  --gradient-body: radial-gradient(circle at 50% -20%, rgba(107, 26, 26, 0.2) 0%, transparent 50%),
    linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
  --gradient-hero: radial-gradient(circle at 50% -20%, rgba(107, 26, 26, 0.3) 0%, transparent 50%),
    linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

body.preload,
body.preload * {
  transition: none !important;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-weight: 700;
}

a {
  color: inherit;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   3. PUBLIC COMPONENTS
   ========================================================================== */
.brand-logo {
  display: none;
  height: 26px;
  width: auto;
}

html:not(.theme-dark) .brand-logo.logo-light {
  display: block;
}

html:not(.theme-dark) .brand-logo.logo-dark {
  display: none;
}

html.theme-dark .brand-logo.logo-light {
  display: none;
}

html.theme-dark .brand-logo.logo-dark {
  display: block;
}

.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  padding: 0 20px;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}

.btn--primary,
.btn-primary {
  background: var(--brand);
  border-color: transparent;
  color: var(--brand-contrast) !important;
  box-shadow: 0 4px 12px rgba(107, 26, 26, 0.3);
}

.btn--primary:hover,
.btn-primary:hover {
  background: var(--brand-600);
  box-shadow: 0 8px 20px rgba(107, 26, 26, 0.35);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-strong);
  border-color: var(--border-hover);
}

.btn.full,
.full {
  width: 100%;
}

.btn-text {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.btn-text:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.theme-dark .card {
  background: var(--surface-strong);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card__body {
  flex-grow: 1;
  padding: 24px;
}

.alert,
.alert-success,
.alert-error,
.alert--success,
.alert--danger {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.92rem;
  font-weight: 600;
}

.alert-success,
.alert--success {
  background: rgba(21, 128, 61, 0.1);
  border: 1px solid rgba(21, 128, 61, 0.18);
  color: #15803d;
}

.alert-error,
.alert--danger {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: #b91c1c;
}

.theme-dark .alert-success,
.theme-dark .alert--success {
  color: #86efac;
}

.theme-dark .alert-error,
.theme-dark .alert--danger {
  color: #fecaca;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="url"],
select,
textarea,
.modern-input,
.otp-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-accent);
  color: var(--text-strong);
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder,
.modern-input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus,
.modern-input:focus,
.otp-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-group,
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group > label,
.input-group > label,
label {
  display: block;
  color: var(--text-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font-weight: 700;
}

.theme-toggle:hover {
  background: var(--surface-strong);
  color: var(--text-strong);
}

.theme-toggle__switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--divider);
}

.theme-toggle__switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.theme-dark .theme-toggle__switch::before {
  transform: translateX(16px);
}

/* ==========================================================================
   4. UTILITIES
   ========================================================================== */
.stack > * + * {
  margin-top: var(--stack-gap, 12px);
}

.text--muted {
  color: var(--muted);
}

.hide {
  display: none !important;
}

.hp-wrapper {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .card__header,
  .card__body {
    padding: 18px;
  }

  .btn,
  .btn-primary,
  .btn-secondary {
    white-space: normal;
  }
}
