@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #C5803D;
  /* CAR orange-brown */
  --primary-hover: #A86828;
  --bg-color: #FBF4EC;
  /* CAR light cream */
  --text-dark: #39271C;
  --text-light: #615249;
  --border-color: #DAA664;
  --topbar-left: #39271C;
  --topbar-right: #C5803D;
  /* CAR orange accent */
  --partner-box: #C5803D;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(147.76deg, #f4e4cd 10.12%, #daa664 112.62%);
  background-attachment: fixed;
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header strip */
.top-bar {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  font-size: 1.25rem;
  /* Increased font size for legibility as requested */
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
}

.top-bar-left {
  color: var(--topbar-left);
}

.top-bar-right {
  color: var(--topbar-right);
}

/* Base layouts */
.main-container {
  flex: 1;
  min-height: 100%;
}

.logo-container {
  margin-top: 2rem;
  margin-bottom: 3.5rem;
}

.logo-container .main-logo {
  max-width: 580px;
  width: 90%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.content-wrapper {
  z-index: 10;
}

/* Search Box */
.search-container {
  margin: 0 auto;
}

.search-input {
  border: 1px solid #DAA664 !important;
  color: var(--text-dark);
  font-size: 2.2rem !important;
  height: 80px;
  border-radius: 15px !important;
  box-shadow: none !important;
  padding-left: 1.5rem !important;
}

.search-input::placeholder {
  color: #615249;
  font-weight: 300;
  font-size: 2.2rem;
}

.search-input:focus {
  border-color: var(--primary-hover) !important;
  box-shadow: 0 0 0 5px rgba(197, 128, 61, 0.25) !important;
  outline: none;
}

.btn-search {
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-size: 2.0rem;
  height: 80px;
  border-radius: 15px !important;
  min-width: 220px;
  transition: all 0.2s;
  box-shadow: none !important;
  font-weight: 400 !important;
  letter-spacing: -0.5px;
}

.btn-search:hover,
.btn-search:focus {
  background-color: var(--primary-hover);
  color: white;
}

/* Custom Error Display Underneath Inputs */
.custom-validation-msg {
  color: #C13B35;
  font-size: 1.1rem;
  font-weight: 400;
  text-align: left;
  margin-left: 20px;
  line-height: 1.5;
}

.search-input.is-invalid {
  border-color: #C13B35 !important;
  background-image: none !important;
  box-shadow: 0 0 0 4px rgba(193, 59, 53, 0.2) !important;
}

/* Partners Block */
.partner-title {
  white-space: nowrap;
  font-size: 1.25rem;
  letter-spacing: -0.2px;
}

.partner-card {
  border: none !important;
  border-radius: 20px !important;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #FFF6EC;
  /* Light peach matching CAR */
}

.partner-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1) !important;
}

.partner-logo-box {
  height: 85px;
}

.partner-desc {
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.4;
  margin-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 10px;
}

/* Footer Connections */
.footer a:hover {
  text-decoration: underline !important;
}

/* General Layout adjustments for the views inserted dynamically */
.custom-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
  margin-bottom: 2rem;
  border: none;
  width: 100%;
  max-width: 600px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--text-dark);
  font-weight: 700;
}

.subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Standard Inputs outside home.erb */
.form-control:not(.search-input) {
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  border: 2px solid var(--border-color);
  background-color: #FEFCF9;
}

.form-control:not(.search-input):focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(197, 128, 61, 0.2) !important;
  background-color: #FFFFFF;
}

/* Additional Buttons outside home.erb */
.btn-primary:not(.btn-search) {
  background-color: var(--primary-color);
  border: none;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(197, 128, 61, 0.2);
}

.btn-primary:not(.btn-search):hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(197, 128, 61, 0.3);
}

.btn-secondary {
  background-color: #F1DDC1;
  color: #39271C;
  border: none;
  font-weight: 600;
  border-radius: 12px;
}

.btn-secondary:hover {
  background-color: #EDD8C3;
  color: #2A1A0F;
}

/* Alerts */
.alert {
  border-radius: 12px;
  border: none;
  font-weight: 500;
}

.alert-danger {
  background-color: #FFECEC;
  color: #B92626;
  border-left: 5px solid #E53E3E;
}

.alert-success {
  background-color: #EDFAEE;
  color: #267936;
  border-left: 5px solid #38B04C;
}

.alert-warning {
  background-color: #FFF6E6;
  color: #925C13;
  border-left: 5px solid #F6AD55;
}

/* Loaders */
.loader-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(251, 244, 236, 0.85);
  z-index: 1050;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 54px;
  height: 54px;
  border: 5px solid rgba(197, 128, 61, 0.2);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Microchip Input special styling */
.microchip-input {
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-align: center;
}

/* OTP Input */
.otp-input {
  font-size: 2rem;
  letter-spacing: 12px;
  text-align: center;
  font-weight: 700;
  height: 80px;
  border-radius: 16px;
  background-color: #FFF !important;
  border: 2px solid var(--border-color);
}

.otp-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(197, 128, 61, 0.2) !important;
}

/* Autocomplete list */
#org-results {
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--border-color);
  border-top: none;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.list-group-item {
  padding: 1rem 1.25rem;
  border: none;
  border-bottom: 1px solid #F0F0F0;
  font-weight: 500;
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover,
.list-group-item:focus {
  background-color: #FFF6EC;
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .search-container form {
    flex-direction: column !important;
  }

  .search-input {
    border-radius: 30px !important;
    font-size: 1.2rem !important;
    text-align: center !important;
  }

  .search-input::placeholder {
    font-size: 1.1rem;
  }

  .btn-search {
    border-radius: 30px !important;
    width: 100%;
  }

  .partner-title {
    font-size: 0.9rem;
    white-space: normal;
    text-align: center;
    width: 90%;
  }

  .custom-card {
    padding: 1.5rem;
  }
}