/* ================================================================
   Weindegustation – Wine Management Form
   weine-form.css  |  requires Bootstrap 3 + wein.css
   ================================================================ */

/* --- Fonts ---------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Nunito:wght@400;500;600&display=swap');

/* --- Custom properties --------------------------------------- */
:root {
  --wf-dark:        #3D1018;
  --wf-mid:         #6B1A2A;
  --wf-accent:      #893d30;
  --wf-soft:        #C4766A;
  --wf-blush:       #F5EAE7;
  --wf-cream:       #FAF6F0;
  --wf-border:      #E5DDD8;
  --wf-text:        #2C1810;
  --wf-muted:       #8C7B75;
}

/* --- Base ---------------------------------------------------- */
body {
  background-color: var(--wf-cream);
  font-family: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
}

.wContainer {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* --- Page wrapper -------------------------------------------- */
.wm-page {
  max-width: 840px;
  margin: 0 auto;
}

/* --- Headings ------------------------------------------------ */
.wm-page h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--wf-dark);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--wf-accent);
  display: inline-block;
  margin-bottom: 16px;
}

/* --- Intro text ---------------------------------------------- */
.wm-page > p,
.wm-page form > p {
  color: var(--wf-muted);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 5px;
}

.wm-page > p a,
.wm-page form > p a {
  color: var(--wf-accent);
}

/* --- Alerts -------------------------------------------------- */
.wm-page .alert {
  border-radius: 6px;
  border-left-width: 4px;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
}

.wm-page .alert.alert-dismissible {
  padding-right: 42px;
}

.wm-page .alert .close {
  right: -6px;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  text-shadow: none;
  opacity: .45;
}

.wm-page .alert .close:hover,
.wm-page .alert .close:focus {
  opacity: .7;
}

.wm-page .alert-success {
  background-color: #EDF7EE;
  border-color: #4CAF50;
  color: #2d6a30;
}

.wm-page .alert-danger {
  background-color: #FDF2F0;
  border-color: var(--wf-accent);
  color: #7A1A1A;
}

.wm-page .alert-warning {
  background-color: #FFF8E6;
  border-color: #F0A500;
  color: #7A5200;
}

.wm-page .alert-success .close {
  color: #2d6a30;
}

.wm-page .alert-danger .close {
  color: #7A1A1A;
}

.wm-page .alert-warning .close {
  color: #7A5200;
}

/* --- Card base ---------------------------------------------- */
.wm-card {
  background: #fff;
  border: 1px solid var(--wf-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(61,16,24,.06);
  transition: box-shadow .2s ease;
}

.wm-card:hover {
  box-shadow: 0 4px 18px rgba(61,16,24,.11);
}

/* --- Card header -------------------------------------------- */
.wm-card-header {
  background: linear-gradient(120deg, var(--wf-mid) 0%, var(--wf-accent) 100%);
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wm-card-header strong {
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .025em;
}

/* Producer card – deeper tone */
.wm-card-producer .wm-card-header {
  background: linear-gradient(120deg, #4A1E2A 0%, var(--wf-mid) 100%);
}

/* --- Table inside card -------------------------------------- */
.wm-card .table {
  margin-bottom: 0;
  border: none;
}

/* Remove default Bootstrap table outer borders inside cards */
.wm-card > .table:first-child,
.wm-card > table:first-child {
  border-top: 0;
}

.wm-card .table > thead > tr > td,
.wm-card .table > thead > tr > th {
  border-bottom: none;
  padding: 12px 18px;
  vertical-align: middle;
}

.wm-card .table > tbody > tr > th,
.wm-card .table > tbody > tr > td {
  border-top: 1px solid var(--wf-border);
  padding: 9px 18px;
  vertical-align: middle;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
}

.wm-card .table > tbody > tr:first-child > th,
.wm-card .table > tbody > tr:first-child > td {
  border-top: none;
}

.wm-card .table > tbody > tr:hover {
  background-color: rgba(250,246,240,.65);
}

/* Label column */
.wm-card .table > tbody > tr > th {
  font-weight: 600;
  font-size: 12px;
  color: var(--wf-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  width: 35%;
}

.wm-card .table > tbody > tr > th small {
  display: block;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: #bbb;
  margin-top: 2px;
}

/* Grape variety section header row */
.wm-card .table > tbody > tr.grapeVariety > th[colspan] {
  text-transform: none;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--wf-mid);
  letter-spacing: 0;
  border-top: 2px solid var(--wf-border);
  padding-top: 14px;
}

/* --- Form controls inside cards ----------------------------- */
.wm-card .form-control,
.wm-card input[type="text"],
.wm-card input[type="number"],
.wm-card select {
  border: 1px solid var(--wf-border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  color: var(--wf-text);
  background-color: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  height: 34px;
  box-shadow: none;
}

.wm-card .form-control:focus,
.wm-card input[type="text"]:focus,
.wm-card input[type="number"]:focus,
.wm-card select:focus {
  outline: none;
  border-color: var(--wf-accent);
  box-shadow: 0 0 0 3px rgba(137,61,48,.12);
}

.wm-card label {
  font-weight: 500;
  font-size: 14px;
  color: var(--wf-text);
  margin-bottom: 0;
}

.wm-card input[type="checkbox"] {
  accent-color: var(--wf-accent);
  margin-right: 5px;
}

.wm-card input[type="radio"] {
  accent-color: var(--wf-accent);
  margin-right: 4px;
}

/* --- Delete button (inside card header) --------------------- */
.wm-card-header .btn-danger {
  background-color: transparent;
  border: 1px solid rgba(255,255,255,.45);
  color: rgba(255,255,255,.9);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  transition: background-color .15s, border-color .15s;
}

.wm-card-header .btn-danger:hover {
  background-color: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.9);
  color: #fff;
}

/* --- Add wine button area ------------------------------------ */
.wm-add-wine-area {
  text-align: center;
  padding: 20px 0 4px;
}

#addWineBtn.btn-success {
  background-color: transparent;
  border: 2px dashed var(--wf-accent);
  color: var(--wf-accent);
  border-radius: 6px;
  padding: 10px 30px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: background-color .15s, color .15s, border-style .15s;
}

#addWineBtn.btn-success:hover,
#addWineBtn.btn-success:focus {
  background-color: var(--wf-blush);
  color: var(--wf-mid);
  border-color: var(--wf-mid);
  border-style: solid;
  outline: none;
}

/* --- Submit area --------------------------------------------- */
.wm-submit-card {
  background: #fff;
  border: 1px solid var(--wf-border);
  border-radius: 8px;
  padding: 22px 24px;
  margin-top: 6px;
  box-shadow: 0 2px 8px rgba(61,16,24,.06);
}

.wm-submit-card .wm-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--wf-text);
}

.wm-submit-card .wm-confirm-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--wf-accent);
  width: 16px;
  height: 16px;
}

.wm-submit-card .btn-primary {
  background-color: var(--wf-mid);
  border-color: var(--wf-dark);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 36px;
  border-radius: 6px;
  letter-spacing: .04em;
  transition: background-color .15s, transform .1s;
}

.wm-submit-card .btn-primary:hover {
  background-color: var(--wf-dark);
  border-color: var(--wf-dark);
  transform: translateY(-1px);
}

.wm-submit-card .btn-primary:active {
  transform: translateY(0);
}

/* --- Required star ------------------------------------------ */
.text-danger {
  color: var(--wf-accent) !important;
  font-weight: 700;
}

/* --- Grape variety inline layout ----------------------------- */
.wm-card .table td select + input[type="text"] {
  margin-left: 12px;
  width: 120px !important;
}

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

  /* Reduce outer whitespace */
  .wContainer {
    padding-top: 16px;
    padding-bottom: 28px;
  }

  /* Stack label above input instead of side-by-side */
  .wm-card .table > tbody > tr > th,
  .wm-card .table > tbody > tr > td {
    display: block;
    width: 100% !important;
    padding-left: 14px;
    padding-right: 14px;
  }

  .wm-card .table > tbody > tr > th {
    padding-bottom: 3px;
  }

  .wm-card .table > tbody > tr > td {
    padding-top: 4px;
    border-top: none;
  }

  /* Larger touch targets, prevent iOS auto-zoom (font-size >= 16px) */
  .wm-card input[type="text"],
  .wm-card input[type="number"],
  .wm-card select {
    width: 100% !important;
    height: 44px;
    font-size: 16px;
  }

  /* Grape variety row: stack select → manually input → share → checkbox */
  .wm-card .table td select + input[type="text"] {
    display: block;
    margin-left: 0;
    margin-top: 8px;
    width: 100% !important;
  }

  /* Share input: override inline margin-left style */
  .wm-card .table tr.grapeVariety td input[name$="[share]"] {
    display: block;
    margin-left: 0 !important;
    margin-top: 8px;
    width: 100% !important;
  }

  /* Checkbox label in grape rows */
  .wm-card .table tr.grapeVariety td label {
    display: block;
    margin-left: 0;
    margin-top: 10px;
  }

  /* Submit button full-width */
  .wm-submit-card .btn-primary {
    width: 100%;
    padding: 13px;
  }

}
