/*
 * Hipotuca Vite Base
 * Global frontend style baseline extracted from hipotek-home-link.
 */

:root {
  --background: 240 8% 96%;
  --foreground: 260 30% 14%;
  --card: 0 0% 100%;
  --card-foreground: 260 30% 14%;
  --popover: 0 0% 100%;
  --popover-foreground: 260 30% 14%;
  --primary: 340 78% 55%;
  --primary-foreground: 0 0% 100%;
  --secondary: 240 8% 94%;
  --secondary-foreground: 260 20% 20%;
  --muted: 240 6% 93%;
  --muted-foreground: 240 8% 48%;
  --accent: 35 92% 54%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 8% 88%;
  --input: 240 8% 88%;
  --ring: 340 78% 55%;
  --radius: 0.75rem;

  --gradient-brand: linear-gradient(90deg, #F5A623 0%, #E8315A 40%, #C4116A 65%, #7B1FAB 100%);
  --gradient-brand-diagonal: linear-gradient(135deg, #F5A623 0%, #E8315A 40%, #7B1FAB 100%);
}

* {
  box-sizing: border-box;
}

/* Tailwind-like border baseline so external styles don't drop borders */
*,
*::before,
*::after {
  border-style: solid;
  border-width: 0;
  border-color: hsl(var(--border));
}

/* Tailwind-like preflight reset for spacing/typography */
html,
body {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

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

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Manrope, sans-serif;
}

/* Utilities used across templates */
.bg-background { background-color: hsl(var(--background)) !important; }
.text-foreground { color: hsl(var(--foreground)) !important; }
.text-muted-foreground { color: hsl(var(--muted-foreground)) !important; }
.border-border { border-color: hsl(var(--border)) !important; }
.border {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: hsl(var(--border)) !important;
}
.font-manrope { font-family: Manrope, sans-serif !important; }
.font-space { font-family: "Space Grotesk", sans-serif !important; }

.brand-gradient {
  background: var(--gradient-brand);
}

.brand-gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-gradient-diagonal {
  background: var(--gradient-brand-diagonal);
}

/* Form baseline (prevents plugin/theme overrides from drifting layout) */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 0.75rem !important;
  padding: 0.625rem 0.75rem !important;
  background: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  font-family: Manrope, sans-serif !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  font-weight: 400 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  text-shadow: none !important;
  background-image: none !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  text-align: left !important;
}

input[type="number"] {
  text-align: left !important;
}

input::placeholder,
textarea::placeholder {
  color: #8b95a5 !important;
  opacity: 1 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2) !important;
}

label {
  display: block;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-family: Manrope, sans-serif;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

/* Theme-wide hard reset layer to neutralize legacy/plugin typography rules */
body.theme-hipotuca-v2 p,
body.theme-hipotuca-v2 h1,
body.theme-hipotuca-v2 h2,
body.theme-hipotuca-v2 h3,
body.theme-hipotuca-v2 h4,
body.theme-hipotuca-v2 h5,
body.theme-hipotuca-v2 h6,
body.theme-hipotuca-v2 ul,
body.theme-hipotuca-v2 ol,
body.theme-hipotuca-v2 li,
body.theme-hipotuca-v2 figure,
body.theme-hipotuca-v2 blockquote {
  margin: 0 !important;
  padding: 0 !important;
}

body.theme-hipotuca-v2 p + p {
  margin-top: 0 !important;
}

body.theme-hipotuca-v2 .text-xs {
  font-size: 0.75rem !important;
  line-height: 1rem !important;
}

body.theme-hipotuca-v2 .text-sm {
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}

/* Hard reset inside calculator wrapper to neutralize theme paragraph spacing */
.hipotuca-calculadoras p,
.hipotuca-calculadoras h1,
.hipotuca-calculadoras h2,
.hipotuca-calculadoras h3,
.hipotuca-calculadoras h4,
.hipotuca-calculadoras h5,
.hipotuca-calculadoras h6 {
  margin: 0 !important;
  padding: 0 !important;
}

.hipotuca-calculadoras .text-xs {
  font-size: 0.75rem !important;
  line-height: 1rem !important;
}

.hipotuca-calculadoras .text-sm {
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}

/*
 * Legacy calculator dark cards -> light Vite cards.
 * Scoped to calculator templates to avoid affecting the rest of the theme.
 */
.hipotuca-calculadoras .bg-\[\#1e1e2d\].rounded-2xl.p-8.text-white {
  background: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  border: 1px solid hsl(var(--border)) !important;
  box-shadow: none !important;
}

.hipotuca-calculadoras .bg-\[\#1e1e2d\].rounded-2xl.p-8.text-white .text-white,
.hipotuca-calculadoras .bg-\[\#1e1e2d\].rounded-2xl.p-8.text-white .text-white\/50,
.hipotuca-calculadoras .bg-\[\#1e1e2d\].rounded-2xl.p-8.text-white .text-white\/40,
.hipotuca-calculadoras .bg-\[\#1e1e2d\].rounded-2xl.p-8.text-white .text-white\/30,
.hipotuca-calculadoras .bg-\[\#1e1e2d\].rounded-2xl.p-8.text-white .text-white\/60 {
  color: hsl(var(--muted-foreground)) !important;
}
