/* ============================================================
   VisitaSmart — Base styles
   Reset minimale + tipografia + safe-area iPhone
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* Previene bounce su iOS */
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--text-body-weight);
  line-height: 1.4;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;  /* dynamic viewport per iOS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Safe area iPhone (notch + home indicator) */
  padding-top: env(safe-area-inset-top);
  /* il padding-bottom è gestito dalla tab bar */
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

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

input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: none;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

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

/* Scrollbar discreta */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: 3px;
}

/* Selection */
::selection {
  background: var(--color-accent);
  color: #fff;
}

/* Tipografia helper classes */
.t-large-title  { font-size: var(--text-large-title);  font-weight: var(--text-large-title-weight);  letter-spacing: -0.025em; }
.t-title-1      { font-size: var(--text-title-1);      font-weight: var(--text-title-1-weight);      letter-spacing: -0.02em; }
.t-title-2      { font-size: var(--text-title-2);      font-weight: var(--text-title-2-weight);      letter-spacing: -0.015em; }
.t-title-3      { font-size: var(--text-title-3);      font-weight: var(--text-title-3-weight); }
.t-headline     { font-size: var(--text-headline);     font-weight: var(--text-headline-weight); }
.t-body         { font-size: var(--text-body);         font-weight: var(--text-body-weight); }
.t-callout      { font-size: var(--text-callout);      font-weight: var(--text-callout-weight); }
.t-subhead      { font-size: var(--text-subhead);      font-weight: var(--text-subhead-weight); }
.t-footnote     { font-size: var(--text-footnote);     font-weight: var(--text-footnote-weight);   color: var(--color-text-secondary); }
.t-caption-1    { font-size: var(--text-caption-1);    font-weight: var(--text-caption-1-weight);   color: var(--color-text-secondary); }

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary  { color: var(--color-text-tertiary); }
.text-accent    { color: var(--color-accent); }
.text-danger    { color: var(--color-danger); }
.text-success   { color: var(--color-success); }
.text-center    { text-align: center; }

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
