/* Global UI layer: Tailwind tokens + compatibility for existing templates. */

:root {
  --ra-bg: #f3f6fb;
  --ra-bg-deep: #dbe8ff;
  --ra-surface: rgba(255, 255, 255, 0.92);
  --ra-surface-strong: #ffffff;
  --ra-border: #d9e3ef;
  --ra-text: #0f172a;
  --ra-muted: #5b677b;
  --ra-primary: #0f3f7d;
  --ra-primary-soft: #1f5ca8;
  --ra-secondary: #f26b1d;
  --ra-success: #0f8f63;
  --ra-danger: #c83b51;
  --ra-warning: #c77d1a;
  --ra-info: #0f7e95;
  --ra-shadow: 0 16px 45px rgba(15, 25, 47, 0.12);
  --ra-radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.ra-modern {
  margin: 0;
  color: var(--ra-body-text, var(--ra-text));
  background:
    radial-gradient(circle at 12% 10%, rgba(53, 103, 207, 0.18), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(242, 107, 29, 0.13), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--ra-bg) 52%, #eef3fb 100%);
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  font-size: var(--ra-body-size, 16px);
  letter-spacing: 0.01em;
  animation: ra-fade-in 420ms ease-out;
}

@keyframes ra-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-title,
.carousel-title,
.page-title {
  margin-top: 0;
  color: #0b2447;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

a {
  color: var(--ra-primary-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover:not(:where(.btn, .btn-custom, .dash-btn)) {
  color: var(--hover-color, var(--ra-brand-accent, var(--ra-secondary)));
}

/* Layout helpers */
.container,
.container-fluid {
  width: min(1200px, calc(100% - 2rem));
  margin-inline: auto;
}

.container-fluid {
  width: min(1360px, calc(100% - 2rem));
}

main.container,
.container.py-4,
.container.mt-5,
.container.text-center,
.container.my-5 {
  background: var(--ra-surface);
  border: 1px solid rgba(217, 227, 239, 0.75);
  border-radius: var(--ra-radius);
  box-shadow: var(--ra-shadow);
  backdrop-filter: blur(3px);
}

body.ra-forms .container,
body.ra-forms .container.mt-5,
body.ra-forms .container.text-center {
  padding: clamp(1.1rem, 2.2vw, 2rem) !important;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -0.5rem;
}

.row > [class*="col-"] {
  width: 100%;
  padding: 0.5rem;
}

.col-3 {
  width: 25%;
}

.col-6 {
  width: 50%;
}

.col-12 {
  width: 100%;
}

@media (min-width: 576px) {
  .col-sm-4 {
    width: 33.333333%;
  }

  .col-sm-8 {
    width: 66.666667%;
  }
}

@media (min-width: 768px) {
  .col-md-2 {
    width: 16.666667%;
  }

  .col-md-3 {
    width: 25%;
  }

  .col-md-4 {
    width: 33.333333%;
  }

  .col-md-6 {
    width: 50%;
  }

  .col-md-8 {
    width: 66.666667%;
  }
}

@media (min-width: 992px) {
  .col-lg-3 {
    width: 25%;
  }

  .col-lg-9 {
    width: 75%;
  }

  .col-lg-10 {
    width: 83.333333%;
  }
}

@media (min-width: 1200px) {
  .col-xl-4 {
    width: 33.333333%;
  }

  .col-xl-9 {
    width: 75%;
  }
}

/* Spacing utilities used across templates */
.mt-1 {
  margin-top: 0.25rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mt-5 {
  margin-top: 2.2rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.my-5 {
  margin-top: 2.2rem !important;
  margin-bottom: 2.2rem !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.pt-3 {
  padding-top: 1rem !important;
}

.pt-5 {
  padding-top: 2.2rem !important;
}

.pb-5 {
  padding-bottom: 2.2rem !important;
}

.gx-2 {
  column-gap: 0.5rem;
}

.gy-3 {
  row-gap: 1rem;
}

.g-4 {
  gap: 1.5rem !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 0.75rem !important;
}

.w-100 {
  width: 100% !important;
}

.h-100 {
  height: 100% !important;
}

.vstack {
  display: flex !important;
  flex-direction: column !important;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-inline {
  display: inline !important;
}

.d-flex {
  display: flex !important;
}

.d-inline-flex {
  display: inline-flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-nowrap {
  flex-wrap: nowrap !important;
}

.overflow-auto {
  overflow: auto !important;
}

.text-center {
  text-align: center !important;
}

.text-muted {
  color: var(--ra-muted) !important;
}

.text-primary {
  color: var(--ra-primary-soft) !important;
}

.text-decoration-none {
  text-decoration: none !important;
}

.bg-white {
  background: #fff !important;
}

.border-bottom {
  border-bottom: 1px solid #dbe5f2 !important;
}

.shadow-sm {
  box-shadow: 0 10px 24px rgba(16, 35, 64, 0.08) !important;
}

.opacity-25 {
  opacity: 0.25 !important;
}

.opacity-50 {
  opacity: 0.5 !important;
}

.small,
small {
  font-size: 0.86rem;
}

.fw-bold {
  font-weight: 700 !important;
}

.fst-italic {
  font-style: italic !important;
}

.fs-4 {
  font-size: 1.5rem !important;
}

.fs-5 {
  font-size: 1.25rem !important;
}

.ms-1 {
  margin-left: 0.25rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

.me-1 {
  margin-right: 0.25rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.ml-2 {
  margin-left: 0.5rem !important;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Buttons */
.btn,
.btn-custom,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.64rem 1.05rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.93rem;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover,
.btn-custom:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 53, 102, 0.2);
}

.btn:disabled,
button:disabled,
.disabled {
  opacity: 0.58;
  pointer-events: none;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
}

.btn-primary,
.btn-brand,
.btn-custom {
  background: linear-gradient(120deg, var(--ra-primary) 0%, var(--ra-primary-soft) 100%);
  color: #fff;
}

.btn-secondary {
  background: #edf2fb;
  border-color: #ccd9eb;
  color: #1f3557;
}

.btn-success {
  background: linear-gradient(120deg, #169b6d 0%, var(--ra-success) 100%);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(120deg, #d68a17 0%, var(--ra-warning) 100%);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(120deg, #dd4f66 0%, var(--ra-danger) 100%);
  color: #fff;
}

.btn-info {
  background: linear-gradient(120deg, #0a93ac 0%, var(--ra-info) 100%);
  color: #fff;
}

.btn-dark {
  background: linear-gradient(120deg, #23324d 0%, #13213a 100%);
  color: #fff;
}

.btn-login {
  background: linear-gradient(120deg, var(--ra-primary) 0%, var(--ra-primary-soft) 100%);
  color: #fff;
}

/* Forms */
label,
.form-label {
  display: inline-block;
  margin-bottom: 0.38rem;
  font-weight: 600;
  color: #1f3557;
}

.form-control,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d7e8;
  border-radius: 12px;
  background: #fdfefe;
  color: #0f172a;
  padding: 0.58rem 0.72rem;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 25, 47, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: #5d93d8;
  box-shadow: 0 0 0 4px rgba(57, 108, 178, 0.16);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 1.12rem;
  height: 1.12rem;
}

.form-control-color {
  width: 4rem;
  min-height: 2.5rem;
  padding: 0.2rem;
}

.form-text {
  color: var(--ra-muted);
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check-input {
  width: 1.15rem;
  height: 1.15rem;
}

.form-check-label {
  margin: 0;
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #c9d7e8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.input-group .form-control {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.input-group .form-control:focus {
  box-shadow: none;
}

.input-group-text {
  display: inline-flex;
  align-items: center;
  padding: 0.58rem 0.72rem;
  background: #edf4ff;
  color: #23416a;
  border-right: 1px solid #d4e0ef;
  font-weight: 700;
}

/* Cards, lists, alerts */
.card,
.highlight,
.property-info,
.filter-panel,
.login-card {
  border: 1px solid rgba(209, 221, 237, 0.95);
  border-radius: 16px;
  background: var(--ra-surface-strong);
  box-shadow: 0 12px 30px rgba(12, 33, 63, 0.1);
}

.card {
  overflow: hidden;
  position: relative;
}

.card-body,
.card-header {
  padding: 1rem;
}

.card-header {
  background: #f6f9ff;
  border-bottom: 1px solid #dbe5f2;
}

.card-title {
  margin-bottom: 0.25rem;
}

.card-img-top {
  width: 100%;
  display: block;
  object-fit: cover;
}

.list-group {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.list-group-item {
  list-style: none;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid #d7e1ef;
  background: #f8fbff;
}

.list-inline {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
}

.list-inline-item {
  display: inline-flex;
  align-items: center;
}

.alert {
  padding: 0.82rem 0.95rem;
  border-radius: 12px;
  border: 1px solid;
}

.alert-danger {
  background: #fff2f4;
  border-color: #f2cad2;
  color: #8c2032;
}

.alert-success {
  background: #ecfbf3;
  border-color: #bce9d0;
  color: #176746;
}

.close {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-size: 1.1rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #d9e4f0;
  background: #fff;
}

.table thead th {
  text-align: left;
  padding: 0.78rem 0.72rem;
  background: #eef4ff;
  color: #1e3456;
  font-weight: 700;
  border-bottom: 1px solid #d9e4f0;
}

.table td {
  padding: 0.72rem;
  border-bottom: 1px solid #edf2f8;
}

.table tr:last-child td {
  border-bottom: none;
}

.table-striped tbody tr:nth-child(odd) {
  background: #f9fbff;
}

.table-bordered td,
.table-bordered th {
  border-right: 1px solid #edf2f8;
}

.table-bordered td:last-child,
.table-bordered th:last-child {
  border-right: none;
}

.align-middle td,
.align-middle th {
  vertical-align: middle;
}

.img-thumbnail {
  border-radius: 11px;
  border: 1px solid #d8e3f0;
  padding: 0.2rem;
  background: #fff;
}

/* Navigation and tabs */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding-left: 0;
  list-style: none;
}

.nav-tabs {
  border-bottom: 1px solid #d7e2f0;
  padding-bottom: 0.45rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: #2a456d;
  padding: 0.5rem 0.84rem;
  border: 1px solid transparent;
  border-radius: 11px;
}

.nav-link:hover {
  border-color: #d6e2f2;
  background: #f4f8ff;
}

.nav-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--ra-primary) 0%, var(--ra-primary-soft) 100%);
}

.btn-group,
.btn-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding-left: 0;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.72rem;
  border-radius: 999px;
  border: 1px solid #d2dff0;
  background: #fff;
  color: #1f3a60;
  font-weight: 700;
}

.page-link:hover {
  background: #edf4ff;
}

.page-item.active .page-link {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--ra-primary) 0%, var(--ra-primary-soft) 100%);
}

.page-item.disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
}

/* Progress and spinner */
.progress {
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebf8;
  border: 1px solid #d4deee;
}

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #2b65b0 0%, #2a8db4 100%);
}

.progress-bar.bg-success {
  background: linear-gradient(120deg, #1b9a6f 0%, #26b082 100%);
}

.spinner-border {
  width: 1.15rem;
  height: 1.15rem;
  border: 0.18rem solid rgba(37, 81, 146, 0.22);
  border-top-color: var(--ra-primary-soft);
  border-radius: 999px;
  display: inline-block;
  animation: ra-spin 0.8s linear infinite;
}

.spinner-border-sm {
  width: 0.9rem;
  height: 0.9rem;
}

@keyframes ra-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Property detail carousel fallback without Bootstrap JS */
.carousel {
  position: relative;
}

.carousel-inner {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.carousel-item {
  display: none;
  width: 100%;
}

.carousel-item.active {
  display: block;
}

.carousel-item img,
.carousel-item .d-flex {
  width: 100%;
}

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(11, 27, 54, 0.66);
  color: #fff;
}

.carousel-control-prev {
  left: 0.75rem;
}

.carousel-control-next {
  right: 0.75rem;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.carousel-control-prev-icon::before {
  content: "\2039";
}

.carousel-control-next-icon::before {
  content: "\203A";
}

.thumbnail-img {
  transition: transform 0.16s ease, box-shadow 0.18s ease;
}

.thumbnail-img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 35, 65, 0.2);
}

.stretched-link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

/* Form journey pages (personal_info) */
body.ra-forms .highlight {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, #f2f7ff 100%) !important;
  border: 1px solid #d4e0f3 !important;
  padding: clamp(0.9rem, 1.8vw, 1.4rem) !important;
}

body.ra-forms .navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
}

body.ra-forms .form-row {
  margin-bottom: 0.75rem !important;
}

body.ra-forms .form-inline {
  gap: 0.55rem;
  flex-wrap: wrap;
}

body.ra-forms .remove-form {
  white-space: nowrap;
}

/* Footer polish */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 -12px 25px rgba(16, 33, 63, 0.14);
}

/* Mobile */
@media (max-width: 767.98px) {
  body.ra-modern {
    background-attachment: scroll;
  }

  .container,
  .container-fluid {
    width: calc(100% - 1rem);
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .btn,
  .btn-custom {
    width: 100%;
  }

  .navigation .btn,
  .navigation a.btn,
  .actions .btn {
    width: auto;
  }
}

/* Header CTA hardening: keep readable contrast even if other hover rules apply */
#site-header .nav a.nav__cta,
#site-header .nav a.nav__cta:hover,
#site-header .nav a.nav__cta:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(92deg, #123d76 0%, #1d5ca7 100%) !important;
  border: 1px solid var(--button-border-color, #ff6f00) !important;
  -webkit-text-fill-color: #ffffff;
}
