:root {
  --brand-primary: #a14429;
  --brand-primary-dark: #873823;
  --brand-primary-light: #c0593a;
  --brand-bg: #fff8f2;
  --brand-bg-accent: #fff0e6;
  --brand-text: #2e1a0f;
}

html,
body {
  height: 100%;
}

body {
  background-color: var(--brand-bg);
  color: var(--brand-text);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content-wrapper {
  flex: 1 0 auto;
}

footer {
  background-color: var(--brand-bg-accent);
  border-top: 1px solid #e8d5c4;
  margin-top: auto;
  flex-shrink: 0;
}

/* DM Serif Display has no Greek glyphs, so it's scoped to the Latin brand
   wordmark only — Greek headings (all of them, this UI is Greek-only) stay
   on Source Sans 3 or they'd silently fall back to the browser's default
   serif per-glyph. */
.navbar-brand {
  font-family: "DM Serif Display", serif;
}

h1, h2, h3 {
  font-weight: 600;
}

.navbar {
  background-color: var(--brand-primary);
}

.navbar-brand {
  color: #fff !important;
}

/* Delivery icon. Bootstrap Icons has no motorbike, so this masks a PNG with
   the current text color to make it size and color like any other `bi-`
   icon. */
.bi-motorbike {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("../icons/motorbike.b0168d37ba78.png") center / contain no-repeat;
  mask: url("../icons/motorbike.b0168d37ba78.png") center / contain no-repeat;
  vertical-align: -0.125em;
}

.btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary-dark);
  --bs-btn-hover-border-color: var(--brand-primary-dark);
  --bs-btn-active-bg: var(--brand-primary-dark);
  --bs-btn-active-border-color: var(--brand-primary-dark);
  --bs-btn-disabled-bg: var(--brand-primary);
  --bs-btn-disabled-border-color: var(--brand-primary);
  --bs-btn-focus-shadow-rgb: 161, 68, 41;
}

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

a:hover {
  color: var(--brand-primary-dark);
}

.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.form-check-input:focus {
  border-color: var(--brand-primary-light);
  box-shadow: 0 0 0 0.25rem rgba(161, 68, 41, 0.25);
}

/* Centered card layout shared by every login/registration/password-reset
   screen (templates/auth_base.html). Capped width on large/medium screens,
   shrinks to the container's own padding on small ones. */
.auth-wrapper {
  padding-block: 1rem 3rem;
}

.auth-card {
  max-width: 440px;
  margin-inline: auto;
  background: #fff;
  border-radius: 0.75rem;
  padding: 2rem 2.25rem;
  box-shadow: 0 0.5rem 1.5rem rgba(46, 26, 15, 0.08);
}

.auth-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card form p {
  margin-bottom: 1rem;
}

/* Outlined, floating-label input — see templates/_outlined_field.html. The
   label sits inline as static text until the field is focused or filled,
   then floats up through the border; the border itself is masked behind
   the label with the card's own background color rather than a true
   notch, since every usage sits on a plain white .auth-card. */
.form-outline {
  position: relative;
  margin-bottom: 1rem;
}

.form-outline > .form-control {
  height: 3.25rem;
  padding: 0 3rem 0 1.1rem;
  border: 1px solid #ddd0c2;
  border-radius: 0.5rem;
  background-color: #fff;
  box-shadow: 0 0.35rem 1rem rgba(46, 26, 15, 0.06);
}

/* Chrome tints autofilled inputs light blue via its own UA styles, which
   otherwise override background-color outright. The inset box-shadow trick
   paints over it; the long transition delay stops the tint from flashing
   in before the shadow takes over. */
.form-outline > .form-control:-webkit-autofill,
.form-outline > .form-control:-webkit-autofill:hover,
.form-outline > .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--brand-text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 5000s ease-in-out 0s;
}

.form-outline > .form-control:focus {
  border-color: var(--brand-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(161, 68, 41, 0.15);
}

.form-outline > label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 0.35rem;
  color: #8a7a6c;
  background-color: #fff;
  font-size: 1rem;
  transition: top 0.15s ease-out, font-size 0.15s ease-out, color 0.15s ease-out;
  pointer-events: none;
}

.form-outline > .form-control:focus ~ label,
.form-outline > .form-control:not(:placeholder-shown) ~ label {
  top: 0;
  font-size: 0.8rem;
}

.form-outline > .form-control:focus ~ label {
  color: var(--brand-primary-light);
}

.form-outline > i.bi {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8a7a6c;
  pointer-events: none;
}

/* Phone input with a fixed Greek country-code prefix — see
   templates/_phone_field.html. The prefix is display-only: the user types
   the national number and the form adds +30 itself. */
.phone-field-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #8a7a6c;
  font-size: 0.9rem;
}

.phone-field {
  display: flex;
  align-items: stretch;
  height: 3.25rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd0c2;
  border-radius: 0.5rem;
  background-color: #fff;
  box-shadow: 0 0.35rem 1rem rgba(46, 26, 15, 0.06);
  overflow: hidden;
}

.phone-field:focus-within {
  border-color: var(--brand-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(161, 68, 41, 0.15);
}

.phone-field-prefix {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem 0 1.1rem;
  border-right: 1px solid #ddd0c2;
  background-color: var(--brand-bg);
  font-weight: 600;
  white-space: nowrap;
}

.phone-field-prefix img {
  width: 1.5rem;
  border-radius: 0.15rem;
  box-shadow: 0 0 0 1px rgba(46, 26, 15, 0.12);
}

.phone-field > .form-control,
.phone-field > .form-control:focus {
  flex: 1;
  min-width: 0;
  padding: 0 1.1rem 0 0.9rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Toasts. Bootstrap's defaults (350px wide, 0.875rem text) are too easy to
   miss in a corner of the screen. */
.toast {
  --bs-toast-max-width: 30rem;
  --bs-toast-font-size: 1.0625rem;
  --bs-toast-padding-x: 1.25rem;
  --bs-toast-padding-y: 1rem;
  --bs-toast-border-radius: 0.75rem;
  --bs-toast-box-shadow: 0 0.75rem 2rem rgba(46, 26, 15, 0.28);
  font-weight: 600;
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--bs-toast-padding-y) var(--bs-toast-padding-x);
}

.toast-body .bi {
  flex-shrink: 0;
  margin-right: 0 !important;
  font-size: 1.5rem;
}

.toast .btn-close {
  margin-right: 1rem !important;
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  color: #dc3545;
  font-size: 0.875rem;
}

.auth-card .auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.auth-card .auth-links p {
  margin-bottom: 0.4rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: #9a8a7c;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e8ddd2;
}

.btn-google {
  --bs-btn-color: #3c4043;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #dadce0;
  --bs-btn-hover-color: #3c4043;
  --bs-btn-hover-bg: #f7f8f8;
  --bs-btn-hover-border-color: #c9cdd1;
  --bs-btn-active-bg: #f1f3f4;
  --bs-btn-active-border-color: #c9cdd1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 500;
}

.btn-google .bi-google {
  font-size: 1.05rem;
  color: #ea4335;
}

@media (max-width: 575.98px) {
  .auth-card {
    padding: 1.5rem 1.25rem;
  }
}
