/* OM Downloader — styled to match A&M Realty Inc. (stlbroker.net) */

:root {
  /* Palette pulled directly from stlbroker.net */
  --primary:        #004274;   /* deep navy (header / brand) */
  --primary-dark:   #00335A;   /* footer / overlay */
  --primary-darker: #002B4B;   /* sidebar / very dark */
  --accent:         #00aeff;   /* link / hover cyan */
  --action:         #00aeef;   /* search button cyan */
  --action-hover:   #3ec0ef;   /* button hover */
  --gold:           #c9a14b;   /* A&M Realty gold from logo */

  --bg:      #f7f8f9;
  --surface: #ffffff;
  --border:  #dce0e0;
  --text:    #222222;
  --muted:   #6b7280;

  --danger:  #b5202b;
  --success: #1f7a3d;

  --radius: 10px;
  --shadow: 0 4px 14px rgba(0, 51, 90, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =====================================================
   HERO HEADER (matches stlbroker.net)
   ===================================================== */

:root {
  --hero-image: url("hero-bg.jpg");
}

.site-header {
  position: relative;
  background:
      linear-gradient(180deg, rgba(0, 51, 90, 0.78) 0%, rgba(0, 66, 116, 0.85) 100%),
      var(--hero-image) center 30% / cover no-repeat;
  color: #fff;
  padding: 22px 0 36px;
  border-bottom: 4px solid var(--accent);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.3px;
}
.brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.brand .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Transparent: the white/orange logo sits directly on the dark hero. */
  background: transparent;
  border-radius: 8px;
  padding: 2px;
}
.brand .brand-logo img {
  display: block;
  max-height: 56px;
  max-width: 220px;
  width: auto;
  height: auto;
}
.brand .brand-tag {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-top: 2px;
}

.admin-nav a {
  margin-left: 18px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  opacity: 0.92;
}
.admin-nav a:hover { color: var(--accent); opacity: 1; text-decoration: none; }
.admin-nav a.logout { color: #ffd9d9; }
.admin-nav a.logout:hover { color: #ffffff; }

/* Optional hero block (used on landing & access pages) */
.hero {
  text-align: center;
  padding: 26px 0 8px;
  color: #fff;
}
.hero h1 {
  font-size: 30px;
  margin: 4px 0 8px 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.hero p {
  margin: 0 auto;
  max-width: 680px;
  font-size: 15px;
  opacity: 0.92;
}

main.wrap { padding-top: 28px; padding-bottom: 60px; }

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
  background: var(--primary-dark);
  color: #cfd8e3;
  font-size: 13px;
  padding: 22px 0;
  text-align: center;
  border-top: 4px solid var(--accent);
}
.site-footer a { color: var(--accent); }

/* =====================================================
   PAGE TITLES
   ===================================================== */

.page-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--primary);
}
.page-subtitle {
  margin: 0 0 24px 0;
  color: var(--muted);
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 20px 0;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 14px 0;
  font-size: 18px;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  display: inline-block;
}
.card .meta-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding: 8px 0;
  flex-wrap: wrap;
  gap: 6px;
}
.card .meta-row:last-child { border-bottom: 0; }
.card .meta-row .label { color: var(--muted); font-weight: 600; }

/* Confidentiality block */
.confidentiality {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: #fafbfd;
  padding: 16px 18px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: #2a3346;
}
.confidentiality h3 {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: var(--primary);
}
.confidentiality .ca-section {
  margin: 14px 0 6px 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.confidentiality .ca-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.confidentiality p { margin: 0 0 12px 0; }

/* =====================================================
   FORMS
   ===================================================== */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

label.field {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
label.field span.req { color: var(--danger); }

input[type=text],
input[type=email],
input[type=tel],
input[type=password],
input[type=file],
input[type=date],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  margin-top: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 174, 255, 0.18);
}
textarea { min-height: 90px; resize: vertical; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #eef6ff;
  border: 1px solid #c8e3f7;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}
.checkbox-row input[type=checkbox] {
  margin-top: 4px;
  transform: scale(1.15);
  accent-color: var(--action);
}
.checkbox-row label { font-size: 14px; line-height: 1.5; }

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
  display: inline-block;
  background: var(--action);
  color: #fff;
  border: 1px solid var(--action);
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  letter-spacing: 0.2px;
}
.btn:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  text-decoration: none;
  color: #fff;
}
.btn.full { display: block; width: 100%; text-align: center; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn.primary:hover {
  background: #003a64;
  border-color: #003a64;
}
.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.secondary:hover { background: #eaf3fb; }
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}
.btn.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 0 18px 0;
  font-size: 14px;
}
.alert.error   { background: #fdecea; color: var(--danger);  border: 1px solid #f6c2c4; }
.alert.success { background: #e8f6ec; color: var(--success); border: 1px solid #c1e6cd; }
.alert.info    { background: #eaf6ff; color: var(--primary); border: 1px solid #c8e3f7; }

ul.error-list { margin: 6px 0 0 18px; padding: 0; }

/* =====================================================
   TABLES
   ===================================================== */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
  min-width: 720px;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 0;
}
table.data tr:hover td { background: #f3f8fc; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.yes   { background: #e8f6ec; color: var(--success); }
.badge.no    { background: #fdecea; color: var(--danger); }
.badge.muted { background: #eef1f6; color: var(--muted); }

/* =====================================================
   LOGIN
   ===================================================== */

.login-wrap {
  max-width: 420px;
  margin: 50px auto;
}

/* =====================================================
   COPYABLE LINK BOX
   ===================================================== */

.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-box input {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}
.link-box button {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12px;
}

/* =====================================================
   SUMMARY STATS
   ===================================================== */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.summary-grid .stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}
.summary-grid .stat .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}
.summary-grid .stat .lbl {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* =====================================================
   HELPERS
   ===================================================== */

.hidden { display: none !important; }
.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.spacer { height: 16px; }
.row    { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.flex-grow { flex: 1; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* =====================================================
   SETTINGS PAGE PREVIEWS
   ===================================================== */

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 720px) {
  .preview-grid { grid-template-columns: 1fr; }
}
.preview {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.preview .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 8px;
}
.preview img.logo-preview {
  max-height: 80px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
.preview .hero-preview {
  height: 120px;
  width: 100%;
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 6px;
}

table.data tr.edit-row td { background: #fafbfd; }
details > summary { outline: none; }
