/**
 * Mobile / tablet layouts (max-width: 767px).
 * Desktop keeps style.css defaults; no scaled “in-between” zoom on phones.
 */

@media (max-width: 767px) {
  html {
    zoom: 1;
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .site-main {
    padding: 0;
  }

  .delimited-container {
    margin: 0;
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 1rem 0.85rem 1.25rem;
    min-height: 0;
    box-shadow: none;
  }

  /* Dashboard header: logo row, then scrollable tabs */
  .dashboard-top-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0 0;
  }

  .dashboard-top-bar__logo {
    display: flex;
    justify-content: center;
  }

  .dashboard-top-bar__logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
  }

  .dashboard-top-bar__tabs-wrap {
    width: 100%;
    overflow: hidden;
  }

  .tabs-nav--dashboard {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0 4px;
    scrollbar-width: none;
    gap: 0;
  }

  .tabs-nav--dashboard::-webkit-scrollbar {
    display: none;
  }

  .tabs-nav--dashboard .tab-link {
    flex: 0 0 auto;
    font-size: var(--font-size-sm);
    padding: 0.65rem 1rem;
    white-space: nowrap;
  }

  .tabs-nav--dashboard .tabs-nav__underline { display: none; }

  .tabs-nav--dashboard {
    position: relative;
  }

  .dashboard-section .kpis.kpis--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
  }

  .dashboard-guide-line {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.45;
    color: #64748b;
  }

  .dashboard-guide-line strong {
    color: #1e293b;
    white-space: nowrap;
  }

  .dashboard-guide-line span::before {
    content: ' — ';
    color: #94a3b8;
  }

  .flash-messages {
    margin: 0.5rem 0.85rem 0;
  }

  .dashboard-guide-grid {
    grid-template-columns: 1fr !important;
  }
}

.dashboard-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.dashboard-guide-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem;
}

@media (max-width: 400px) {
  .dashboard-section .kpis.kpis--compact {
    grid-template-columns: 1fr !important;
  }

  .dashboard-top-bar__logo-img {
    height: 40px;
  }

  .tabs-nav--dashboard .tab-link {
    font-size: var(--font-size-xs);
    padding: 0.55rem 0.75rem;
  }
}

/* Desktop dashboard header (768px+) */
@media (min-width: 768px) {
  .dashboard-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
  }

  .dashboard-top-bar__logo-img {
    height: 108px;
    width: auto;
    object-fit: contain;
  }

  .dashboard-top-bar__tabs-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .tabs-nav--dashboard {
    position: relative;
    margin: 0;
    border-bottom: 1px solid rgba(31, 77, 143, 0.14);
    width: auto;
    flex-wrap: nowrap;
  }

  .tabs-nav--dashboard .tab-link {
    white-space: nowrap;
  }

  .tabs-nav--dashboard .tabs-nav__underline { display: none; }

  .dashboard-guide-line {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: #64748b;
  }

  .dashboard-guide-line strong {
    color: #1e293b;
  }

  .dashboard-guide-line span::before {
    content: ' — ';
    color: #94a3b8;
  }
}

/* Signup / login auth cards */
@media (max-width: 767px) {
  .signup-container,
  .login-hero,
  .auth-hero {
    min-height: auto;
    padding: 1.25rem 0.85rem 2rem;
    align-items: flex-start;
  }

  .signup-card,
  .login-card,
  .auth-card {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 1.15rem;
    border-radius: 12px;
  }

  .signup-form input,
  .signup-form select,
  .login-form input[type="email"],
  .login-form input[type="password"] {
    font-size: 16px;
  }
}

/* Landing: full-width mobile page */
@media (max-width: 767px) {
  .landing-page {
    width: 100%;
    overflow-x: hidden;
  }

  /* Landing header mobile rules live in landing.html (max-width: 899px) */

  .hero-section {
    padding: 28px 16px 24px !important;
  }

  .section {
    padding: 32px 16px !important;
  }

  .pricing-grid,
  .pricing-grid-five,
  .threats-grid,
  .benefits-grid {
    grid-template-columns: 1fr !important;
  }
}
