/* LeaseGuard: the one look shared by every experience (templates/shell/base.html).
   Loaded after Bootstrap 5.3 (dark theme). Page-specific rules stay in the page.
   Served with a content hash in the URL (shell.asset_url): nginx caches /static/ for a year. */

:root {
  --primary: #EB6514;
  --primary-light: #F08A4A;
  --primary-dark: #d55a0a;
  --text: #1a1d23;
  --text-light: #a7b3c6;   /* secondary text on the dark background: >= 7:1 */
  --bg: #0f0f12;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius-xl: 1.5rem;
  --radius-lg: 1rem;
  --radius: 0.75rem;
  --shadow-glow: 0 0 40px rgba(235, 101, 20, 0.15);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shell-bar-height: 64px;
  --shell-sections-height: 45px;
}

[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: #e2e8f0;
  --bs-body-font-family: 'Inter', sans-serif;
  --bs-heading-color: #fff;
  --bs-primary: var(--primary);
  --bs-primary-rgb: 235, 101, 20;
  --bs-link-color: var(--primary-light);
  --bs-link-color-rgb: 240, 138, 74;
  --bs-link-hover-color: #ffb58a;
  --bs-link-hover-color-rgb: 255, 181, 138;
  --bs-border-color: var(--glass-border);
  --bs-secondary-color: var(--text-light);
}

body {
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
  padding-top: calc(var(--shell-bar-height) + 1px);   /* the fixed bar and its border */
}

/* --- Animated background (behind everything) --- */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(125deg, #0f0f12 0%, #1a1a2e 100%);
  overflow: hidden;
}
.bg-animation::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(circle at 20% 50%, rgba(235, 101, 20, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(240, 138, 74, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.3;
  animation: orb-float 15s ease-in-out infinite;
}
.orb-1 { width: 300px; height: 300px; background: var(--primary); top: 10%; left: 10%; animation-duration: 20s; }
.orb-2 { width: 200px; height: 200px; background: #3b82f6; bottom: 20%; right: 10%; animation-duration: 25s; animation-delay: -5s; }
.orb-3 { width: 250px; height: 250px; background: #8b5cf6; top: 50%; left: 50%; animation-duration: 30s; animation-delay: -10s; }
@keyframes float {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-animation::before, .floating-orb { animation: none; }
}

/* --- Top bar: logo, experience switcher, account --- */
.shell-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: rgba(15, 15, 18, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.shell-bar.scrolled {
  background: rgba(15, 15, 18, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.shell-bar .navbar {
  min-height: var(--shell-bar-height);
  padding: 0;
}
.shell-bar .container-xxl { gap: 0 1.5rem; }
.shell-logo {
  display: flex;
  align-items: center;
  height: var(--shell-bar-height);
  margin: 0;
  padding: 0;
}
.shell-logo img {
  display: block;
  width: 180px;
  height: auto;
  transition: transform 0.3s ease;
}
.shell-logo:hover img { transform: scale(1.05); }
/* Phone and tablet: the bar says which experience this is; the menu button switches. */
.shell-current {
  margin: 0 0 0 auto;
  padding: .25rem .8rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.shell-bar .navbar-toggler {
  margin: 0;
  padding: .35rem .6rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.shell-bar .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(235, 101, 20, 0.25); }

.shell-tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.shell-tab {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  color: var(--text-light);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.shell-tab:hover, .shell-tab:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.06); }
.shell-tab.active { background: var(--primary); color: #fff; }

.shell-account {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 0 auto;
}
.shell-account a { color: #e2e8f0; font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.shell-account a:hover { color: #fff; }

.shell-sections { border-top: 1px solid var(--glass-border); }
.shell-sections ul {
  display: flex;
  align-items: center;
  gap: .25rem;
  height: calc(var(--shell-sections-height) - 1px);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}
.shell-section {
  display: block;
  margin: 0;
  padding: .3rem .8rem;
  border-radius: 999px;
  color: var(--text-light);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
}
.shell-section:hover, .shell-section:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.06); }
.shell-section.active { color: var(--primary-light); background: rgba(235, 101, 20, 0.12); }

@media (min-width: 992px) {
  body.has-sections { padding-top: calc(var(--shell-bar-height) + var(--shell-sections-height) + 1px); }
}
@media (max-width: 991.98px) {
  /* Phone and tablet: switcher, sections and account open from the menu button. */
  .shell-bar .container-xxl { gap: 0 .75rem; }
  .shell-logo img { width: 150px; }
  .shell-bar .navbar-collapse {
    max-height: calc(100vh - var(--shell-bar-height));
    overflow-y: auto;
    padding: .25rem 0 1rem;
  }
  .shell-tabs { display: flex; flex-direction: column; border-radius: var(--radius-lg); }
  .shell-tab { padding: .7rem 1rem; border-radius: var(--radius); }
  .shell-menu-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem;
    margin: .75rem 0 0;
    padding: 0;
    list-style: none;
  }
  .shell-menu-sections .shell-section { border-radius: var(--radius); padding: .55rem 1rem; }
  .shell-account {
    justify-content: space-between;
    margin: .75rem 0 0;
    padding-top: .75rem;
    border-top: 1px solid var(--glass-border);
  }
}

/* --- Pages built with plain Bootstrap markup (Ritiri, login, access denied) --- */
.shell-page { padding-top: 2rem; padding-bottom: 2rem; }

.shell-footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-light);
  margin-top: 5rem;
}
.shell-footer p { margin: 0; }

/* --- LeaseGuard cards --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow), var(--shadow-soft);
  border-color: rgba(235, 101, 20, 0.3);
}
.glass-card:hover::before { opacity: 1; }
.glass-card > .card-header {
  display: flex;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(235, 101, 20, 0.1) 0%, transparent 100%);
  border-bottom: 1px solid var(--glass-border);
  margin: -2rem -2rem 2rem -2rem;
  font-weight: 600;
  font-size: 1.25rem;
  color: white;
}
.glass-card > .card-header i {
  margin-right: 1rem;
  font-size: 1.5rem;
  color: var(--primary);
}

/* Bootstrap's .card in the same glass look. Data cards hold forms and tables,
   so they do not blur or move; only a card that is a link lifts on hover. */
.card {
  --bs-card-bg: var(--glass-bg);
  --bs-card-border-color: var(--glass-border);
  --bs-card-border-radius: var(--radius-lg);
  --bs-card-inner-border-radius: var(--radius-lg);
  --bs-card-color: #e2e8f0;
}
a.card { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow), var(--shadow-soft);
  border-color: rgba(235, 101, 20, 0.3);
}

/* --- Buttons --- */
.btn { --bs-btn-border-radius: var(--radius); --bs-btn-focus-shadow-rgb: 235, 101, 20; }
.btn-sm { --bs-btn-border-radius: .5rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  color: white;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.btn-primary.btn-sm { padding: .35rem .9rem; font-size: .78rem; border-radius: .5rem; }
.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(235, 101, 20, 0.3);
  color: white;
}
.btn-primary:hover::before { width: 300px; height: 300px; }
.btn-primary:active { transform: translateY(0); }
.btn-outline-primary {
  --bs-btn-color: var(--primary-light);
  --bs-btn-border-color: rgba(235, 101, 20, 0.6);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
  --bs-btn-active-color: #fff;
}
.btn-outline-secondary {
  --bs-btn-color: #e2e8f0;
  --bs-btn-border-color: rgba(255, 255, 255, 0.18);
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.12);
  --bs-btn-active-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-color: var(--text-light);
  --bs-btn-disabled-border-color: rgba(255, 255, 255, 0.12);
}

/* --- Forms --- */
.form-label { color: #e2e8f0; font-size: .9rem; font-weight: 500; margin-bottom: .35rem; }
.form-text { color: var(--text-light); font-size: .8rem; line-height: 1.4; }
.form-control, .form-select {
  background-color: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color-scheme: dark;            /* dark date picker, calendar icon and option list */
}
.form-control::placeholder { color: #8b97ab; opacity: 1; }
.form-control:focus, .form-select:focus {
  background-color: rgba(255, 255, 255, 0.09);
  color: #f1f5f9;
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(235, 101, 20, 0.25);
}
.form-control:disabled, .form-select:disabled { background-color: rgba(255, 255, 255, 0.03); color: var(--text-light); }
.form-select option { background: #1a1a22; color: #f1f5f9; }
.form-check-input { background-color: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(235, 101, 20, 0.25); }
.input-group-text { background-color: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.18); color: var(--text-light); }

/* --- Tables, alerts, badges, small text --- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: var(--glass-border);
  --bs-table-hover-bg: rgba(235, 101, 20, 0.07);
  --bs-table-hover-color: #fff;
}
.table thead th {
  color: var(--text-light);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom-color: rgba(255, 255, 255, 0.18);
}
/* A list table that stands alone on the page gets its own glass panel. */
.shell-page > .table-responsive {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: .5rem 1rem;
}
.shell-page > .table-responsive > .table { margin-bottom: 0; }
.shell-page > .table-responsive > .table > tbody > tr:last-child > td { border-bottom: 0; }

.alert {
  --bs-alert-bg: var(--glass-bg);
  --bs-alert-color: #e2e8f0;
  --bs-alert-border-color: var(--glass-border);
  --bs-alert-border-radius: var(--radius);
  border-left: 4px solid var(--text-light);
}
.alert-success { border-left-color: var(--success); }
.alert-warning { border-left-color: var(--warning); }
.alert-danger { border-left-color: var(--danger); --bs-alert-color: #fecaca; }
.alert-info { border-left-color: var(--info); }

.text-secondary { color: var(--text-light) !important; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--text-light); --bs-breadcrumb-item-active-color: var(--text-light); }
.badge-todo { background: #5a3a12; color: #ffd8a8; }
.muted-row td { opacity: .55; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
::-webkit-scrollbar-thumb { background: rgba(235, 101, 20, 0.3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(235, 101, 20, 0.5); }
