/* =========================
   RESET & GRUND
   ========================= */
* { box-sizing: border-box; }

html, body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

:root{
  --bg: #f6f6f6;
  --card: #ffffff;
  --muted: #6b7280;
  --border: #e8e8f2;
  --shadow: 0 10px 26px rgba(0,0,0,.06);

  --brand: #2a9d8f;
  --primary: #007BFF;
}

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: #111;
  padding: 16px;
  overflow-x: hidden;
}

/* =========================
   🔒 iOS FIX – INGEN ZOOM VID INPUT
   ========================= */
input, select, textarea, button{
  font-size: 16px !important; /* KRITISKT för iPhone */
  touch-action: manipulation;
}

/* =========================
   NAV
   ========================= */
nav{
  background: #fff;
  padding: 14px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border-radius: 14px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

nav a{
  text-decoration:none;
  color:#111;
  font-weight: 700;
}

nav .links{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

nav .sep{ color:#bbb; }

/* =========================
   HERO / SÖK
   ========================= */
.hero{
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  text-align:center;
}

.hero h1{
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
}

/* SÖKRAD (matchar index.html) */
.search-bar{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top: 10px;
}

.search-bar input{
  padding: 12px 12px;
  border: 1px solid #d9d9e6;
  border-radius: 12px;
  outline:none;
  background:#fff;

  min-width: 220px;
  flex: 1 1 260px;
  max-width: 360px;

  min-height: 48px; /* steg 3: ingen layout-shift */
}

.search-bar input:focus{
  border-color: rgba(42,157,143,.6);
  box-shadow: 0 0 0 4px rgba(42,157,143,.12);
}

.search-bar button{
  padding: 12px 14px;
  border:none;
  border-radius: 12px;
  cursor:pointer;
  background: var(--primary);
  color:#fff;
  font-weight: 800;

  min-width: 140px;
  min-height: 48px; /* steg 3 */
}

/* =========================
   RESULTATLISTA
   ========================= */
#searchResults{
  margin-top: 16px;
}

/* RESULT-KORT (matchar .result-card i index.html) */
.result-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
  box-shadow: var(--shadow);
  margin-bottom: 12px;

  display:grid;
  grid-template-columns: 1fr 260px;
}

.result-body{
  padding: 14px;
}

.result-body h3{
  margin: 0 0 6px;
  font-size: 18px;
}

.result-body p{
  margin: 6px 0;
}

.price-list{
  margin: 8px 0 0;
  padding-left: 18px;
}

.price-list li{ margin: 4px 0; }

.result-media{
  border-left: 1px solid var(--border);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px;
}

.result-media img{
  width: 100%;
  max-width: 260px;
  height: 180px;
  object-fit: cover; /* snyggast */
  border-radius: 12px;
  background: #f3f3f8;
}

/* BOKA-KNAPP */
.boka-knapp{
  display:inline-block;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  text-decoration:none;
  font-weight: 800;
}

.boka-knapp:hover{ opacity: .95; }

/* =========================
   FEATURES
   ========================= */
.features{
  margin-top: 16px;
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  text-align:center;
}

.feature-box{
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
  width: 260px;
  box-shadow: var(--shadow);
}

.feature-box p{ color: var(--muted); margin:0; }

/* =========================
   MOBILANPASSNING
   ========================= */
@media (max-width: 780px){
  body{ padding: 12px; }

  nav{
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero h1{ font-size: 20px; }

  .search-bar{
    gap: 8px;
  }

  .search-bar input,
  .search-bar button{
    width: 100%;
    max-width: 100%;
  }

  .result-card{
    grid-template-columns: 1fr; /* stapla */
  }

  .result-media{
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .result-media img{
    max-width: 100%;
    height: 200px;
  }

  .feature-box{
    width: 100%;
    max-width: 520px;
  }
}
/* =========================
   DESKTOP FIX – använd hela skärmen
   ========================= */

/* Ge en bred container på desktop */
@media (min-width: 900px) {
  body {
    padding: 24px;
  }

  /* Centrera men nyttja bredden */
  nav,
  .hero,
  .features,
  #searchResults {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Hero får lite mer luft */
  .hero {
    padding: 24px;
  }

  /* Sökraden ska ligga snyggt i rad på desktop */
  .search-bar {
    flex-wrap: nowrap;
    align-items: center;
  }

  .search-bar input {
    max-width: none;        /* ta bort begränsningen */
    flex: 1 1 auto;
  }

  .search-bar button {
    min-width: 180px;
  }

  /* Resultatkort: lite större bildkolumn på desktop */
  .result-card {
    grid-template-columns: 1fr 360px;
  }

  .result-media img {
    max-width: 360px;
    height: 220px;
  }

  /* Features: 3 i rad */
  .features {
    justify-content: space-between;
  }

  .feature-box {
    width: 32%;
    min-width: 260px;
  }
}
/* =========================
   LOGOTYP-KÄNSLA (INGEN FÄRG)
   ========================= */
.site-title{
  width: 100%;
  text-align: center;
  font-weight: 900;
  font-size: 3rem;              /* ca 3× större */
  letter-spacing: .14em;        /* logotyp-känsla */
  text-transform: uppercase;
  line-height: 1;
  padding: 6px 0;
}

/* Behåll länkarna snygga under/vid sidan (mobil/desktop) */
nav{
  justify-content: center;
}

/* Desktop: låt länkarna ligga åt höger men titeln vara centrerad */
@media (min-width: 900px){
  nav{
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .site-title{
    grid-column: 2;
    width: auto;
  }
  nav .links{
    grid-column: 3;
    justify-self: end;
  }
}
/* =========================================================
   AUTH PAGES (Skapa konto / Logga in)
   ========================================================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* Wrapper */
.auth-wrap {
  width: 100%;
  max-width: 520px;
  padding: 16px;
}

/* Kortet */
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 32px;
  box-shadow: var(--shadow);
}

/* Header */
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

/* Logotyp-känsla (ingen färg) */
.auth-logo {
  font-size: 2.6rem;          /* ca 3× normal text */
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* Undertitel */
.auth-subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Fält */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111;
}

/* Inputs */
.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1rem;
}

.auth-form input::placeholder {
  color: #9ca3af;
}

.auth-form input:focus {
  outline: none;
  border-color: rgba(42,157,143,.6);
  box-shadow: 0 0 0 4px rgba(42,157,143,.12);
}

/* Grid för desktop (2 kolumner) */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Knapp */
.auth-btn {
  margin-top: 10px;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.auth-btn:hover {
  opacity: 0.95;
}

/* Länkar */
.auth-links {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.auth-links a {
  text-decoration: none;
  font-weight: 700;
}

.auth-links .sep {
  margin: 0 6px;
  color: var(--muted);
}

/* =========================
   MOBIL
   ========================= */
@media (max-width: 600px) {

  .auth-card {
    padding: 22px 18px 26px;
    border-radius: 18px;
  }

  .auth-logo {
    font-size: 2.2rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   DESKTOP
   ========================= */
@media (min-width: 900px) {

  .auth-wrap {
    max-width: 560px;
  }

  .auth-logo {
    font-size: 3rem;
  }
}
/* =========================
   INLOGGAD – GRID för bilar (desktop + mobil)
   ========================= */
.page-title{
  margin: 6px 0 14px;
  font-size: 22px;
  font-weight: 900;
}

/* Listan */
#carList{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

/* Desktop: flera kolumner */
@media (min-width: 900px){
  #carList{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* Stora skärmar: 3 kolumner */
@media (min-width: 1200px){
  #carList{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Finputsning i headern */
.card-header .card-info strong{
  display:block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.card-img{
  width: 88px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f3f4f6;
}/* =========================================
   INLOGGAD – LISTA (1 kort per rad, klickbar)
   ========================================= */

/* 1) Tvinga lista istället för grid */
#carList{
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

/* 2) Kort ska vara breda och centrerade på desktop */
#carList .card{
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

/* 3) Headern ska vara “klickbar rad” över hela bredden */
#carList .card-header{
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  width: 100%;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
  background: #fafafa;
}

/* Vänsterinfo */
#carList .card-info strong{
  display:block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}
#carList .card-info{
  font-size: 14px;
}

/* Bild i header */
#carList .card-img{
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  flex: 0 0 auto;
}

/* 4) “Pil” som visar att den går att öppna */
#carList .card-header::after{
  content: "▾";
  font-weight: 900;
  opacity: .55;
  margin-left: 6px;
}
#carList .card .form-section.active ~ .card-header::after{
  content: "▴";
}

/* 5) Utfällbar del – snygg panel */
#carList .form-section{
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}
#carList .form-section.active{
  display: block;
}

/* 6) Mobil: lite mindre bild */
@media (max-width: 600px){
  #carList .card-img{
    width: 82px;
    height: 56px;
    border-radius: 10px;
  }
}
/* =========================================
   INLOGGAD – PROFFSIGA ACTION-KNAPPAR
   ========================================= */

.header-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* Bas */
.action-btn{
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #111;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all .15s ease;
  white-space: nowrap;
}

/* Hover */
.action-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.08);
}

/* Primär (huvudaction) */
.action-btn.primary{
  background: var(--brand);
  color: #fff;
  border-color: rgba(0,0,0,.05);
}

/* Neutral */
.action-btn.ghost{
  background: #f9fafb;
}

/* Farlig (logga ut / ta bort) */
.action-btn.danger{
  background: #fff;
  color: #991b1b;
  border-color: #fecaca;
}
.action-btn.danger:hover{
  background: #fee2e2;
}

/* Mobil */
@media (max-width: 600px){
  .header-actions{
    flex-direction: column;
  }

  .action-btn{
    width: 100%;
    text-align: center;
  }
}

