/* ==========================================================================
   FOODEXL — Authentication design system
   Shared by login, register, forgot, reset, 2FA and the public contact page.
   Palette follows the FOODEXL logo: amber accent on deep ink, red kept for errors.
   ========================================================================== */

:root {
  /* Brand — sampled straight from the logo artwork: the red of the swirl
     (#ec3338) and the amber of the wordmark (#fcb316). */
  --brand-red: #ec3338;
  --brand-red-hover: #d5262b;
  --brand-red-deep: #b81f24;
  --brand-amber: #fcb316;
  --brand-amber-hover: #e39f09;

  /* the ink tones stay for text and shadows, no longer as the primary colour */
  --brand-ink: #2b211c;
  --brand-ink-hover: #1d1613;
  --brand-ink-deep: #150f0d;

  /* Semantic (kept as --primary so existing views/inline styles keep working).
     The deeper red is used for filled buttons so white text clears 4.5:1. */
  --primary: #d5262b;
  --primary-hover: #b81f24;
  --accent: #fcb316;
  --primary-ring: rgba(236, 51, 56, 0.18);

  --bg-color: #f3f1ee;   /* warm neutral, so the page does not read cool next to the ink panel */
  --card-bg: #ffffff;
  --text-main: #14203a;
  --text-muted: #6b7793;
  --border-color: #e3e8f1;
  --input-bg: #f4f6fb;
  --danger: #e0384f;

  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --shadow-card:
    0 1px 2px rgba(24, 16, 14, 0.04),
    0 8px 20px -12px rgba(184, 31, 36, 0.18),
    0 32px 64px -28px rgba(24, 16, 14, 0.30);
}

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

/* Hide Browser Native Password Icons */
input::-ms-reveal,
input::-ms-clear,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  display: none !important;
}

/* Fix Autofill Backgrounds */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  -webkit-text-fill-color: var(--text-main) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.input-group:not(:focus-within) input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
}

html {
  min-height: 100%;
  background-color: var(--bg-color);
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(60% 55% at 8% 8%, rgba(236, 51, 56, 0.13), transparent 60%),
    radial-gradient(55% 50% at 95% 92%, rgba(252, 179, 22, 0.20), transparent 60%),
    radial-gradient(40% 40% at 70% 10%, rgba(255, 255, 255, 0.7), transparent 60%);
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  -webkit-font-smoothing: antialiased;
}

.auth-wrapper {
  width: 100%;
  padding: 20px;
}

/* We hide the side image for this centered design */
.auth-side-image {
  display: none;
}

.auth-side-form {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.form-container {
  background: var(--card-bg);
  width: 100%;
  max-width: 400px;
  padding: 38px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  animation: fadeInUp .55s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.995);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-box {
  text-align: center;
  margin-bottom: 22px;
}

.logo-box img {
  height: 60px;
  width: auto;
}

.form-header {
  display: none; /* Removed based on the screenshot */
}

/* Heading shown above the fields */
.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 7px;
}

.form-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--text-main);
  margin-bottom: 8px;
}

.required {
  color: var(--danger);
}

.input-group {
  display: flex;
  align-items: stretch;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
  height: 50px;
}

/* the icon is quiet until the field is in use */
.input-group .icon-box {
  transition: color .18s ease;
  color: var(--text-muted);
}
.input-group:focus-within .icon-box {
  color: var(--primary);
}

.input-group:hover {
  border-color: #cfd8e8;
}

.input-group:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-ring), 0 6px 16px -12px rgba(184, 31, 36, 0.5);
}

.input-group .icon-box {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 15px;
  flex-shrink: 0;
  background: transparent !important;
  border: none !important;
}

.form-control {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  padding: 0 14px 0 2px;
  font-family: 'Outfit', sans-serif;
  font-size: 14.5px;
  color: var(--text-main);
  outline: none !important;
  box-shadow: none !important;
  height: 100%;
}

.form-control::placeholder {
  color: #9aa5bd;
}

.password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  color: #97a3bb;
  cursor: pointer;
  transition: color 0.2s ease;
  flex-shrink: 0;
  border: none !important;
  background: transparent !important;
  outline: none !important;
}

.password-toggle:hover {
  color: var(--primary);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  font-size: 14px;
}

.remember-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.remember-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.forgot-pass {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.forgot-pass:hover {
  color: var(--brand-amber-hover);
}

.btn-container {
  text-align: center;
}

.btn-submit {
  background: linear-gradient(180deg, var(--brand-red) 0%, var(--primary) 55%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: 14px 30px;
  letter-spacing: .01em;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .2s ease, transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
  box-shadow: 0 12px 24px -10px rgba(184, 31, 36, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover {
  filter: saturate(1.06) brightness(1.03);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgba(184, 31, 36, 0.5);
}

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

.btn-submit:focus-visible,
.btn-contact:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-ring), 0 12px 24px -10px rgba(184, 31, 36, 0.45);
}

.btn-contact {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border-color);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.btn-contact:hover {
  background: rgba(236, 51, 56, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.back-link, .footer-copyright {
  display: none; /* Cleaning up based on the focused card design */
}

/* Error states */
.error-text {
  display: block;
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 6px;
}

.has-error .input-group {
  border-color: var(--danger);
  background: rgba(224, 56, 79, 0.04);
}

.has-error .input-group:focus-within {
  box-shadow: 0 0 0 4px rgba(224, 56, 79, 0.14);
}

/* ==========================================================================
   Login page — split brand panel + form
   Scoped to .login-page so register / forgot / reset / 2FA stay centered.
   ========================================================================== */

.login-page .auth-card {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.login-page .form-container {
  max-width: none;
  padding: 46px 48px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  animation: none;
}

/* The logo sits in the brand panel on desktop */
.login-page .logo-box {
  display: none;
}

.auth-brand-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 46px 42px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(252, 179, 22, 0.45), transparent 55%),
    linear-gradient(158deg, #f4592f 0%, var(--brand-red) 42%, var(--brand-red-deep) 100%);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Pushes the headline + points block down so the logo anchors the top
   without leaving a void in the middle of the panel. */
.auth-brand-panel .brand-intro {
  margin-top: auto;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}

.auth-brand-panel::before {
  width: 300px;
  height: 300px;
  top: -110px;
  right: -90px;
  background: radial-gradient(circle, rgba(255, 214, 122, 0.38), transparent 70%);
}

.auth-brand-panel::after {
  width: 340px;
  height: 340px;
  bottom: -150px;
  left: -110px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
}

.brand-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  background: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}

.brand-logo-chip img {
  height: 44px;
  width: auto;
  display: block;
}

.brand-headline {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
  text-wrap: balance;
}

.brand-headline em {
  font-style: normal;
  color: var(--brand-amber);
}

.brand-copy {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  max-width: 34ch;
}

.brand-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.brand-points i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12.5px;
}

/* Text links: the rule slides in rather than appearing all at once. */
.forgot-pass,
.auth-alt-action a,
.login-redirect a {
  position: relative;
  text-decoration: none;
}
.forgot-pass::after,
.auth-alt-action a::after,
.login-redirect a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.forgot-pass:hover::after,
.auth-alt-action a:hover::after,
.login-redirect a:hover::after {
  transform: scaleX(1);
}

/* the brand chip lifts a little when the panel is hovered */
.auth-brand-panel:hover .brand-logo-chip {
  transform: translateY(-2px);
}

/* nothing moves for anyone who asked the system to keep things still */
@media (prefers-reduced-motion: reduce) {
  .form-container { animation: none; }
  .btn-submit,
  .brand-logo-chip,
  .forgot-pass::after,
  .auth-alt-action a::after,
  .login-redirect a::after { transition: none; }
}

/* Login buttons stack full width */
.login-page .btn-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-page .btn-submit,
.login-page .btn-contact {
  width: 100%;
}

.auth-alt-action {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-alt-action a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-alt-action a:hover {
  color: var(--brand-amber-hover);
}

/* ==========================================================================
   Dark mode
   ========================================================================== */

html.dark {
  --bg-color: #101018;
  --card-bg: #1a1a22;
  --text-main: #e6edf3;
  --text-muted: #8f9bb1;
  --border-color: #2a2a38;
  --input-bg: #13131a;
  --primary-ring: rgba(93, 138, 232, 0.18);
}

html.dark body {
  background-color: var(--bg-color) !important;
  background-image:
    radial-gradient(circle at 10% 15%, rgba(16, 64, 158, 0.28), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(250, 177, 22, 0.10), transparent 45%);
  color: var(--text-main);
}

html.dark .form-container,
html.dark .login-page .auth-card {
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7) !important;
}

html.dark .login-page .form-container {
  box-shadow: none !important;
}

html.dark .input-group:hover {
  border-color: #3a3a4c;
}

html.dark .input-group:focus-within {
  background: var(--input-bg) !important;
  border-color: #5d8ae8;
}

html.dark .input-group .icon-box,
html.dark .forgot-pass,
html.dark .auth-alt-action a {
  color: #7ea2ee;
}

html.dark .btn-submit {
  background: #1a4bb8;
}

html.dark .btn-submit:hover {
  background: #1f57d0;
}

html.dark input:-webkit-autofill,
html.dark input:-webkit-autofill:hover,
html.dark input:-webkit-autofill:focus,
html.dark input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #13131a inset !important;
  -webkit-text-fill-color: var(--text-main) !important;
}

html.dark .password-toggle {
  color: #8a99ad;
}

html.dark .password-toggle:hover {
  color: #7ea2ee;
}

html.dark .btn-contact {
  color: var(--text-main);
  border-color: var(--border-color);
}

html.dark .btn-contact:hover {
  background: rgba(126, 162, 238, 0.1);
  border-color: #5d8ae8;
  color: #cfe0ff;
}

/* ==========================================================================
   Register Page Styles
   ========================================================================== */

.register-page .form-container {
  max-width: 680px;
  padding: 40px;
  border-radius: var(--radius-lg);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 20px;
}

.form-grid .full-width {
  grid-column: span 2;
}

.select-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 35px !important;
}

.select-arrow {
  position: absolute;
  right: 15px;
  pointer-events: none;
  color: var(--primary);
  font-size: 12px;
}

.register-page .btn-container {
  grid-column: span 2;
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.register-page .btn-submit {
  width: 100%;
  justify-content: center;
  padding: 14px 35px;
  border-radius: var(--radius-sm);
}

.login-redirect {
  grid-column: span 2;
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: var(--text-muted);
}

.login-redirect a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-redirect a:hover {
  color: var(--brand-amber-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  /* Brand panel folds away; the form keeps its own logo */
  .login-page .auth-card {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
  .auth-brand-panel {
    display: none;
  }
  .login-page .logo-box {
    display: block;
  }
  .login-page .form-container {
    padding: 38px 34px;
  }
}

@media (max-width: 768px) {
  body {
    display: block !important;
    padding: 20px 10px !important;
  }
  .auth-side-form {
    display: block !important;
  }
  .form-container {
    margin: 0 auto !important;
    max-width: 100% !important;
    border-radius: 18px !important;
    padding: 26px 20px !important;
  }
  .login-page .auth-card {
    max-width: 100%;
    border-radius: 18px;
  }
  .login-page .form-container {
    border-radius: 0 !important;
    padding: 30px 22px !important;
  }
  .form-title {
    font-size: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }
  .form-grid .full-width,
  .register-page .btn-container,
  .login-redirect {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .form-container,
  .login-page .auth-card {
    animation: none;
  }
  .btn-submit:hover {
    transform: none;
  }
}
