/* Referral program styles. Colors and fonts match the roofer landing page (views/pages/landing.cfm). */

:root {
	--ref-navy: #0D1B2A;
	--ref-ink: #1A1A1A;
	--ref-muted: #6B6560;
	--ref-rust: #C84B2F;
	--ref-rust-dark: #9A3520;
	--ref-teal: #128274;
	--ref-amber: #E8A020;
	--ref-cream: #FAF7F2;
	--ref-sand: #F4EDE9;
	--ref-line: #E7E0D8;
	--ref-card: #FFFFFF;
	--ref-radius: 12px;
}

html { padding-top: 64px; }

body {
	background: var(--ref-cream);
	color: var(--ref-ink);
	font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
	font-size: 15px;
}

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; color: var(--ref-navy); }

a { color: var(--ref-rust); }
a:hover, a:focus { color: var(--ref-rust-dark); }

/* ---------- Navbar ---------- */

.ref-nav.navbar {
	background: var(--ref-navy);
	border: 0;
	min-height: 64px;
}
.ref-nav .navbar-brand {
	color: #fff;
	font-weight: 600;
	height: 64px;
	line-height: 34px;
}
.ref-nav .navbar-brand:hover { color: #fff; }
.ref-nav .navbar-brand span { color: rgba(255,255,255,.6); font-weight: 400; }
.ref-nav .navbar-brand .ref-flag {
	display: inline-block; width: 10px; height: 10px; border-radius: 2px;
	background: var(--ref-rust); margin-right: 8px; vertical-align: 1px;
}
.ref-nav .navbar-nav > li > a {
	color: rgba(255,255,255,.75);
	line-height: 34px;
}
.ref-nav .navbar-nav > li > a:hover,
.ref-nav .navbar-nav > li > a:focus,
.ref-nav .navbar-nav > .open > a,
.ref-nav .navbar-nav > .open > a:hover,
.ref-nav .navbar-nav > .open > a:focus { color: #fff; background: transparent; }
.ref-nav .navbar-nav > li > a:focus:not(:focus-visible) { outline: 0; }
.ref-nav .navbar-nav > li.active > a { color: #fff; box-shadow: inset 0 -3px 0 var(--ref-rust); }
.ref-nav .navbar-toggle { border-color: rgba(255,255,255,.3); margin-top: 15px; }
.ref-nav .navbar-toggle .icon-bar { background: #fff; }
.ref-nav .navbar-collapse { border-color: rgba(255,255,255,.1); }
.ref-nav .ref-nav-code {
	font-family: Menlo, Consolas, monospace;
	background: rgba(255,255,255,.1);
	border-radius: 6px;
	padding: 3px 8px;
	margin-left: 4px;
	color: #fff;
}
@media (max-width: 767px) {
	.ref-nav .navbar-nav > li.active > a { box-shadow: inset 3px 0 0 var(--ref-rust); }
	.ref-nav .navbar-nav .open .dropdown-menu > li > a { color: rgba(255,255,255,.75); }
}

/* ---------- Page ---------- */

.ref-page { padding: 24px 0 48px; }
.ref-page-head {
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
	gap: 12px; margin-bottom: 20px;
}
.ref-page-head h1 { font-size: 30px; margin: 0; }
.ref-page-head p { color: var(--ref-muted); margin: 4px 0 0; }

.ref-card {
	background: var(--ref-card);
	border: 1px solid var(--ref-line);
	border-radius: var(--ref-radius);
	padding: 20px 24px;
	margin-bottom: 16px;
}
.ref-card-title {
	font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
	color: var(--ref-muted); margin: 0 0 4px;
}

/* Referral code card */
.ref-code-card {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	background: var(--ref-navy); border-color: var(--ref-navy); color: #fff;
}
.ref-code-card .ref-card-title { color: rgba(255,255,255,.65); }
.ref-code {
	font-family: Menlo, Consolas, monospace;
	font-size: 34px; font-weight: 600; letter-spacing: 3px; line-height: 1.1;
}
.ref-code-help { color: rgba(255,255,255,.7); font-size: 13px; margin: 6px 0 0; }
.ref-code-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-modal-share { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ref-link-input {
	flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 8px;
	border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
	color: #fff; font-family: Menlo, Consolas, monospace; font-size: 13px;
}
.ref-link-input:focus { outline: 0; border-color: rgba(255,255,255,.6); }

/* Buttons */
.ref-btn {
	display: inline-block; border-radius: 8px; padding: 9px 16px;
	font-weight: 600; font-size: 14px; border: 1px solid transparent;
	cursor: pointer; text-decoration: none; line-height: 1.3;
}
.ref-btn:hover, .ref-btn:focus { text-decoration: none; }
.ref-btn-primary { background: var(--ref-rust); color: #fff; }
.ref-btn-primary:hover, .ref-btn-primary:focus { background: var(--ref-rust-dark); color: #fff; }
.ref-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.ref-btn-ghost:hover, .ref-btn-ghost:focus { background: rgba(255,255,255,.1); color: #fff; }
.ref-btn-outline { background: #fff; color: var(--ref-navy); border-color: var(--ref-line); }
.ref-btn-outline:hover, .ref-btn-outline:focus { border-color: var(--ref-navy); color: var(--ref-navy); }
.ref-btn-block { display: block; width: 100%; text-align: center; padding: 12px 16px; }

/* Stat tiles */
.ref-stats {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px; margin-bottom: 16px;
}
.ref-stat {
	background: var(--ref-card); border: 1px solid var(--ref-line);
	border-radius: var(--ref-radius); padding: 16px 20px;
}
.ref-stat-label { font-size: 13px; color: var(--ref-muted); }
.ref-stat-value { font-size: 28px; font-weight: 600; color: var(--ref-navy); line-height: 1.2; margin-top: 2px; }
.ref-stat-value.is-good { color: var(--ref-teal); }
.ref-stat-note { font-size: 12px; color: var(--ref-muted); margin-top: 2px; }

/* Filter bar */
.ref-filter {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--ref-line);
}
.ref-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-preset {
	font-size: 13px; padding: 5px 12px; border-radius: 999px;
	border: 1px solid var(--ref-line); color: var(--ref-ink); background: #fff;
}
.ref-preset:hover, .ref-preset:focus { border-color: var(--ref-navy); color: var(--ref-navy); text-decoration: none; }
.ref-preset.is-active { background: var(--ref-navy); border-color: var(--ref-navy); color: #fff; }
.ref-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ref-muted); }
.ref-range input {
	border: 1px solid var(--ref-line); border-radius: 8px; padding: 5px 8px;
	font-size: 13px; color: var(--ref-ink); background: #fff; height: 32px;
}
.ref-range .ref-btn { padding: 6px 12px; font-size: 13px; }

/* Referral / payment rows */
.ref-list { margin: 0; padding: 0; list-style: none; }
.ref-row {
	display: grid; grid-template-columns: minmax(0, 1fr) auto 90px;
	gap: 12px; align-items: center;
	padding: 14px 0; border-bottom: 1px solid var(--ref-line);
}
.ref-row:last-child { border-bottom: 0; }
.ref-row-title { font-weight: 600; color: var(--ref-navy); }
.ref-row-meta { font-size: 13px; color: var(--ref-muted); }
.ref-row-amount { text-align: right; font-weight: 600; }
.ref-row-amount.is-muted { color: var(--ref-muted); font-weight: 400; }

.ref-pill {
	display: inline-block; font-size: 12px; font-weight: 600;
	padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.ref-pill-paid { background: var(--ref-sand); color: var(--ref-muted); }
.ref-pill-due { background: #DDF1EE; color: #0B5A50; }
.ref-pill-progress { background: #E8F0FE; color: #1E4A8C; }
.ref-pill-pending { background: #FEF3C7; color: #92400e; }
.ref-pill-cancelled { background: #FBE7E3; color: var(--ref-rust-dark); }

/* Empty state */
.ref-empty { text-align: center; padding: 36px 16px; }
.ref-empty h3 { font-size: 22px; margin: 0 0 6px; }
.ref-empty p { color: var(--ref-muted); max-width: 420px; margin: 0 auto 16px; }

/* Payments bars */
.ref-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 8px; overflow-x: auto; }
.ref-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 48px; }
.ref-bar-fill { width: 100%; max-width: 48px; background: var(--ref-teal); border-radius: 6px 6px 0 0; min-height: 3px; }
.ref-bar-label { font-size: 11px; color: var(--ref-muted); margin-top: 6px; white-space: nowrap; }
.ref-bar-value { font-size: 11px; color: var(--ref-ink); margin-bottom: 4px; white-space: nowrap; }

/* Forms */
.ref-form .form-group label { font-weight: 600; font-size: 13px; color: var(--ref-navy); }
.ref-form .form-control {
	border-radius: 8px; border-color: var(--ref-line); box-shadow: none; height: 42px;
}
.ref-form .form-control:focus { border-color: var(--ref-navy); box-shadow: 0 0 0 3px rgba(13,27,42,.1); }
.ref-form .form-hint { font-size: 12px; color: var(--ref-muted); margin-top: 4px; }
.ref-form label.error { color: var(--ref-rust); font-size: 12px; font-weight: 400; margin: 4px 0 0; }
.ref-form .form-control.error { margin-left: 0; color: var(--ref-ink); font-size: 14px; border-color: var(--ref-rust); }

.ref-alert {
	border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
	border: 1px solid transparent;
}
.ref-alert-success { background: #DDF1EE; color: #0B5A50; border-color: #BFE3DD; }
.ref-alert-danger { background: #FBE7E3; color: var(--ref-rust-dark); border-color: #F3CBC2; }

/* Steps (how it works) */
.ref-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.ref-step-num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; border-radius: 50%;
	background: var(--ref-sand); color: var(--ref-rust); font-weight: 700; margin-bottom: 8px;
}
.ref-step h4 { font-size: 15px; font-weight: 600; color: var(--ref-navy); margin: 0 0 4px; }
.ref-step p { font-size: 13px; color: var(--ref-muted); margin: 0; }

/* ---------- Public pages ---------- */

.ref-hero {
	display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 32px; align-items: center; padding: 16px 0 32px;
}
.ref-eyebrow {
	font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
	color: var(--ref-rust); margin-bottom: 10px;
}
.ref-hero h1 { font-size: 44px; line-height: 1.1; margin: 0 0 16px; }
.ref-lead { font-size: 18px; color: #3D3833; line-height: 1.55; margin: 0 0 18px; }
.ref-checks { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ref-checks li { font-weight: 500; color: var(--ref-navy); }
.ref-checks li:before { content: "\2713"; color: var(--ref-teal); font-weight: 700; margin-right: 8px; }
.ref-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0; }
.ref-hero-cta .ref-btn { padding: 12px 24px; font-size: 15px; }
.ref-hero-cta span { color: var(--ref-muted); font-size: 14px; }

.ref-rates { margin: 0; }
.ref-rates-sub { font-size: 13px; color: var(--ref-muted); margin: 0 0 4px; }
.ref-rate {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	padding: 12px 0; border-bottom: 1px solid var(--ref-line);
}
.ref-rate:last-child { border-bottom: 0; padding-bottom: 0; }
.ref-rate-value { font-size: 22px; font-weight: 700; color: var(--ref-teal); }
.ref-rate-value.is-muted { color: var(--ref-muted); }

.ref-how { margin-bottom: 32px; }
#signup, #agreement { scroll-margin-top: 80px; }

.ref-signup h2, .ref-agreement h2 { font-size: 26px; margin: 0 0 4px; }
.ref-signup-sub { color: var(--ref-muted); margin: 0 0 20px; }
.ref-agree { font-size: 13px; color: var(--ref-muted); margin: 4px 0 16px; }

.ref-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ref-choice {
	display: block; position: relative; cursor: pointer; margin: 0;
	border: 1px solid var(--ref-line); border-radius: 10px; padding: 12px 14px 12px 38px;
	background: #fff; font-weight: 400;
}
.ref-choice input { position: absolute; left: 14px; top: 15px; margin: 0; accent-color: var(--ref-rust); }
.ref-choice-title { display: block; font-weight: 600; color: var(--ref-navy); }
.ref-choice-desc { display: block; font-size: 12px; color: var(--ref-muted); }
.ref-choice.is-selected { border-color: var(--ref-rust); box-shadow: 0 0 0 1px var(--ref-rust); background: #FFFBF8; }

.ref-agreement { padding: 4px 8px 0 0; }
.ref-agreement h2 { margin-bottom: 12px; }
.ref-agreement h4 { font-size: 15px; font-weight: 600; color: var(--ref-navy); margin: 20px 0 6px; }
.ref-agreement p, .ref-fine li { font-size: 14px; color: #3D3833; line-height: 1.6; }
.ref-note {
	background: var(--ref-sand); border-radius: 10px; padding: 14px 16px; margin: 20px 0 4px;
	font-size: 14px; line-height: 1.55; color: #3D3833;
}
.ref-note strong:first-child { display: block; color: var(--ref-rust-dark); margin-bottom: 4px; }
.ref-fine { padding-left: 18px; margin: 0; }
.ref-fine li { font-size: 13px; color: var(--ref-muted); margin-bottom: 8px; }

/* Login / reset */
.ref-auth { max-width: 420px; margin: 32px auto 0; }
.ref-auth h1 { font-size: 30px; margin: 0 0 4px; text-align: center; }
.ref-auth-sub { text-align: center; color: var(--ref-muted); margin: 0 0 20px; }
.ref-auth .ref-card { padding: 24px; }
.ref-auth-row { display: flex; justify-content: space-between; align-items: center; margin-top: -4px; margin-bottom: 6px; }
.ref-auth-row label { margin: 0; }
.ref-auth-row a { font-size: 13px; }
.ref-auth-foot { text-align: center; color: var(--ref-muted); font-size: 14px; margin-top: 16px; }
.ref-alert-info { background: #E8F0FE; color: #1E4A8C; border-color: #CCDBF7; }

.ref-modal .modal-content { border-radius: var(--ref-radius); border: 0; }
.ref-modal .modal-header { border-bottom: 0; padding-bottom: 0; }
.ref-modal .modal-title { margin: 0; }
.ref-modal .modal-footer { border-top: 0; }

/* Footer */
.ref-footer {
	border-top: 1px solid var(--ref-line); margin-top: 24px; padding: 20px 0 32px;
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
	font-size: 13px; color: var(--ref-muted);
}
.ref-footer p { margin: 0; }
.ref-footer a { color: var(--ref-muted); }

@media (max-width: 991px) {
	.ref-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.ref-agreement { margin-top: 8px; padding: 0; }
}

@media (max-width: 600px) {
	.ref-hero h1 { font-size: 32px; }
	.ref-lead { font-size: 16px; }
	.ref-choices { grid-template-columns: 1fr; }
	.ref-auth { margin-top: 12px; }
	.ref-page-head h1 { font-size: 26px; }
	.ref-card { padding: 16px; }
	.ref-code { font-size: 28px; }
	.ref-code-actions, .ref-code-actions .ref-btn { width: 100%; text-align: center; }
	.ref-row { grid-template-columns: minmax(0, 1fr) auto; }
	.ref-row .ref-pill { grid-column: 1; grid-row: 2; justify-self: start; }
	.ref-row-amount { grid-column: 2; grid-row: 1 / span 2; }
}
