/* ==========================================================================
   BASE.CSS
   Global reset, layout, typography, utilities
   ========================================================================== */

/* --- Reset / base --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
    "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* Remove default margins */
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  border: none;
  cursor: pointer;
  background: none;
}

input,
textarea {
  font: inherit;
}

/* --- Layout containers --- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
}

.site-header,
.site-footer {
  flex-shrink: 0;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

/* --- Typography helpers --- */

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.2rem, 3vw + 1.2rem, 3.3rem);
}

h2 {
  font-size: clamp(1.7rem, 2vw + 1rem, 2.1rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  font-size: 0.96rem;
}

.text-sm {
  font-size: 0.85rem;
}

.text-xs {
  font-size: 0.78rem;
}

.text-muted {
  opacity: 0.8;
}

.text-center {
  text-align: center;
}

/* --- Sections --- */

.section {
  padding-block: 4rem;
}

.section-alt {
  padding-block: 4rem;
}

/* Section header block */
.section-header {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h1,
.section-header h2 {
  margin-bottom: 0.75rem;
}

/* --- Buttons (base) --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  transition:
    background-color 0.16s ease-out,
    color 0.16s ease-out,
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out,
    transform 0.08s ease-out;
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 0.98rem;
}

.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
}

/* --- Inputs (base) --- */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.input-label {
  font-size: 0.84rem;
}

.input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  outline: none;
  min-height: 2.6rem;
}

textarea.input {
  resize: vertical;
}

.input-error {
  font-size: 0.8rem;
}

/* --- Generic card --- */

.card {
  border-radius: 1rem;
  padding: 1.1rem 1.1rem;
}

/* --- Grids & flex helpers --- */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Auth layout --- */

.page-auth-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 1.2rem;
  padding: 1.9rem 1.8rem 1.7rem;
}

.auth-header {
  margin-bottom: 1.4rem;
}

.auth-header h1 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.auth-footer {
  margin-top: 1.1rem;
  font-size: 0.85rem;
}

/* --- Footer --- */

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1.2rem;
}

.footer-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* --- Utilities / spacing --- */

.mt-sm {
  margin-top: 0.6rem;
}
.mt-md {
  margin-top: 1.1rem;
}
.mt-lg {
  margin-top: 1.7rem;
}

.mb-sm {
  margin-bottom: 0.6rem;
}
.mb-md {
  margin-bottom: 1.1rem;
}
.mb-lg {
  margin-bottom: 1.7rem;
}

/* --- Responsive adjustments (base) --- */

@media (max-width: 1024px) {
  .container {
    padding-inline: 1.1rem;
  }
}

@media (max-width: 768px) {
  .section,
  .section-alt {
    padding-block: 3rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
