/* RRR Enterprises - Professional Stylesheet
 * Clean, trustworthy banking/insurance-style design.
 * Minimal, lightweight, mobile-responsive.
 */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px; line-height: 1.6; color: #1a1a2e; background: #f8f9fa;
}
a { color: #1a5276; text-decoration: none; }
a:hover { color: #154360; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* === Typography === */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: #0d2137; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { position: relative; display: inline-block; }
.section-title h2::after {
    content: ''; display: block; width: 60px; height: 3px;
    background: #1a5276; margin: 12px auto 0; border-radius: 2px;
}
.section-subtitle { color: #5d6d7e; font-size: 1.1rem; margin-top: 0.5rem; }

/* === Buttons === */
.btn {
    display: inline-block; padding: 12px 28px; border-radius: 6px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    border: 2px solid transparent; transition: all 0.2s ease;
    text-align: center;
}
.btn-primary {
    background: #1a5276; color: #fff; border-color: #1a5276;
}
.btn-primary:hover { background: #154360; border-color: #154360; color: #fff; }
.btn-secondary {
    background: transparent; color: #1a5276; border-color: #1a5276;
}
.btn-secondary:hover { background: #1a5276; color: #fff; }
.btn-success { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-success:hover { background: #219a52; color: #fff; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #a93226; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; border-color: #f39c12; }
.btn-warning:hover { background: #d68910; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-block { display: block; width: 100%; }

/* === Header / Navbar === */
.header {
    background: #fff; border-bottom: 1px solid #e8e8e8;
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 0; flex-wrap: wrap;
}
.navbar-brand {
    font-size: 1.5rem; font-weight: 800; color: #0d2137;
    display: flex; align-items: center; gap: 8px;
}
.navbar-brand span { color: #1a5276; }
.navbar-brand img { height: 40px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
    color: #2c3e50; font-weight: 500; font-size: 0.95rem;
    padding: 0.5rem 0; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: #1a5276; }
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: #1a5276; transition: width 0.2s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-toggle { display: none; flex-direction: column; cursor: pointer; gap: 5px; }
.nav-toggle span { width: 25px; height: 2px; background: #2c3e50; border-radius: 2px; }

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links { display: none; width: 100%; flex-direction: column; padding: 1rem 0; gap: 0.5rem; }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.75rem 0; }
}

/* === Hero Section === */
.hero {
    background: #0d2137;
    color: #fff; padding: 6rem 0; text-align: center;
}
.hero h1 { font-size: 3rem; color: #fff; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; color: #d5e8f0; max-width: 700px; margin: 0 auto 2rem; }
.hero .btn { margin: 0 0.5rem 0.5rem; }
.hero-stats {
    display: flex; justify-content: center; gap: 3rem; margin-top: 3rem; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 2.5rem; font-weight: 800; color: #fff; }
.hero-stat-label { font-size: 0.9rem; color: #a0c4e8; margin-top: 0.25rem; }

@media (max-width: 768px) {
    .hero { padding: 3rem 0; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .hero-stats { gap: 1.5rem; }
    .hero-stat-value { font-size: 1.8rem; }
}

/* === Services Section === */
.services { padding: 5rem 0; background: #fff; }
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.service-card {
    background: #f8f9fa; border-radius: 10px; padding: 1.75rem;
    border: 1px solid #e8e8e8; transition: all 0.2s ease;
}
.service-card:hover {
    transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: #1a5276;
}
.service-icon {
    width: 50px; height: 50px; border-radius: 10px;
    background: #e8f0fe; display: flex; align-items: center;
    justify-content: center; margin-bottom: 1rem; font-size: 1.5rem;
}
.service-card h3 { margin-bottom: 0.5rem; font-size: 1.15rem; }
.service-card p { color: #5d6d7e; font-size: 0.95rem; line-height: 1.5; }
.service-category {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
    color: #1a5276; font-weight: 700; margin-bottom: 0.25rem;
}
/* === Referral How-it-Works === */
.how-it-works { padding: 5rem 0; background: #f8f9fa; }
.steps {
    display: flex; justify-content: center; gap: 2rem;
    flex-wrap: wrap; counter-reset: step;
}
.step {
    flex: 1; min-width: 200px; max-width: 260px;
    text-align: center; position: relative;
}
.step-number {
    width: 60px; height: 60px; border-radius: 50%;
    background: #1a5276; color: #fff; font-size: 1.5rem;
    font-weight: 800; display: flex; align-items: center;
    justify-content: center; margin: 0 auto 1rem;
}
.step h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.step p { color: #5d6d7e; font-size: 0.9rem; }
.step:not(:last-child)::after {
    content: '→'; position: absolute; top: 15px; right: -1.5rem;
    font-size: 1.5rem; color: #1a5276;
}
@media (max-width: 768px) {
    .step:not(:last-child)::after { display: none; }
}

/* === Testimonials === */
.testimonials { padding: 5rem 0; background: #fff; }
.testimonial-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem;
}
.testimonial-card {
    background: #f8f9fa; border-radius: 10px; padding: 2rem;
    border: 1px solid #e8e8e8;
}
.testimonial-text { font-style: italic; color: #2c3e50; margin-bottom: 1rem; line-height: 1.6; }
.testimonial-author { font-weight: 700; color: #0d2137; }
.testimonial-role { font-size: 0.85rem; color: #5d6d7e; }

/* === Contact / Enquiry Form === */
.contact { padding: 5rem 0; background: #f8f9fa; }
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start;
}
.contact-info h3 { margin-bottom: 1rem; }
.contact-info-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; align-items: flex-start; }
.contact-info-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: #e8f0fe; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block; font-weight: 600; margin-bottom: 0.4rem;
    font-size: 0.9rem; color: #2c3e50;
}
.form-control {
    width: 100%; padding: 12px 14px; border: 2px solid #d5dbdb;
    border-radius: 6px; font-size: 1rem; font-family: inherit;
    transition: border-color 0.2s; background: #fff;
}
.form-control:focus { outline: none; border-color: #1a5276; }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-error { color: #c0392b; font-size: 0.85rem; margin-top: 0.3rem; display: none; }
.form-control.error { border-color: #c0392b; }

@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

/* === Footer === */
.footer {
    background: #0d2137; color: #a0c4e8; padding: 3rem 0 1.5rem;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem; margin-bottom: 2rem;
}
.footer h4 { color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.footer a { color: #a0c4e8; font-size: 0.9rem; display: block; margin-bottom: 0.5rem; }
.footer a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem; text-align: center; font-size: 0.85rem;
}

/* === Auth Pages === */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f8f9fa; padding: 2rem; }
.auth-card {
    background: #fff; border-radius: 12px; padding: 2.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08); width: 100%; max-width: 420px;
}
.auth-card h2 { text-align: center; margin-bottom: 0.5rem; }
.auth-card .subtitle { text-align: center; color: #5d6d7e; margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: #5d6d7e; }
.auth-footer a { font-weight: 600; }

/* === Alert / Flash Messages === */
.alert {
    padding: 14px 18px; border-radius: 6px; margin-bottom: 1.5rem;
    font-size: 0.95rem; border: 1px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }

/* === Dashboard Layout === */
.dashboard {
    display: flex; min-height: 100vh;
}
.dashboard-sidebar {
    width: 260px; background: #0d2137; color: #fff; padding: 1.5rem 0;
    position: fixed; top: 0; left: 0; height: 100%; overflow-y: auto;
    z-index: 100;
}
.dashboard-sidebar .brand {
    padding: 0 1.5rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.2rem; font-weight: 800; color: #fff; display: block;
}
.dashboard-sidebar .nav-section { padding: 0.5rem 0; }
.dashboard-sidebar .nav-section-title {
    padding: 0.75rem 1.5rem 0.25rem; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 1px; color: #5d8aa8;
}
.dashboard-sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 0.75rem 1.5rem; color: #a0c4e8; font-size: 0.9rem;
    transition: all 0.2s;
}
.dashboard-sidebar a:hover, .dashboard-sidebar a.active {
    background: rgba(255,255,255,0.08); color: #fff;
}
.dashboard-main {
    flex: 1; margin-left: 260px; padding: 2rem; background: #f8f9fa;
    min-height: 100vh;
}
.dashboard-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.dashboard-header h2 { margin: 0; }
.dashboard-header .user-info { display: flex; align-items: center; gap: 1rem; }

@media (max-width: 768px) {
    .dashboard-sidebar { width: 100%; position: relative; height: auto; }
    .dashboard-main { margin-left: 0; }
    .dashboard { flex-direction: column; }
}

/* === Stats Cards === */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem; margin-bottom: 2rem;
}
.stat-card {
    background: #fff; border-radius: 10px; padding: 1.5rem;
    border: 1px solid #e8e8e8;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: #0d2137; }
.stat-card .stat-label { font-size: 0.85rem; color: #5d6d7e; margin-top: 0.25rem; }
.stat-card .stat-icon { font-size: 2rem; float: right; opacity: 0.2; }
.stat-card.primary { border-left: 4px solid #1a5276; }
.stat-card.danger { border-left: 4px solid #e74c3c; }
.stat-card.danger .stat-value { color: #e74c3c; }

/* === Tables === */
.table-responsive { overflow-x: auto; }
table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
thead { background: #f1f3f4; }
th { padding: 12px 16px; text-align: left; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.5px; color: #5d6d7e; font-weight: 700; }
td { padding: 12px 16px; border-top: 1px solid #f0f0f0; font-size: 0.9rem; }
tr:hover td { background: #f8f9fa; }

/* === Badges === */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; text-transform: capitalize;
}
.badge-primary { background: #e8f0fe; color: #1a5276; }
.badge-secondary { background: #f1f3f4; color: #5d6d7e; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* === Filters Bar === */
.filters {
    display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem;
    align-items: center;
}
.filters select, .filters input {
    padding: 8px 12px; border: 2px solid #d5dbdb; border-radius: 6px;
    font-size: 0.9rem; font-family: inherit; background: #fff;
}
.filters select:focus, .filters input:focus { outline: none; border-color: #1a5276; }

/* === Pagination === */
.pagination {
    display: flex; gap: 0.5rem; justify-content: center; margin-top: 2rem;
    flex-wrap: wrap;
}
.page-link {
    padding: 8px 14px; border-radius: 6px; border: 1px solid #d5dbdb;
    font-size: 0.9rem; color: #2c3e50; background: #fff;
    transition: all 0.2s;
}
.page-link:hover { background: #e8f0fe; border-color: #1a5276; }
.page-link.active { background: #1a5276; color: #fff; border-color: #1a5276; }
.page-dots { padding: 8px 6px; color: #5d6d7e; }

/* === Cards (generic) === */
.card {
    background: #fff; border-radius: 10px; border: 1px solid #e8e8e8;
    padding: 1.5rem; margin-bottom: 1.5rem;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.card-header h3 { margin: 0; }

/* === Modal === */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff; border-radius: 12px; padding: 2rem;
    width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 1rem; }

/* === Referral Link Copy === */
.referral-box {
    background: #e8f0fe; border: 2px dashed #1a5276;
    border-radius: 10px; padding: 1.5rem; text-align: center; margin-bottom: 2rem;
}
.referral-box .code {
    font-size: 1.5rem; font-weight: 800; color: #1a5276;
    letter-spacing: 2px; margin: 0.5rem 0;
}
.referral-box .link {
    font-size: 0.85rem; color: #5d6d7e; word-break: break-all;
    margin-bottom: 0.75rem;
}

/* === Utility === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #5d6d7e; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* === Loading Spinner === */
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid #d5dbdb; border-top-color: #1a5276;
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Empty State === */
.empty-state { text-align: center; padding: 3rem; color: #5d6d7e; }

/* === Print === */
@media print {
    .dashboard-sidebar, .nav-toggle, .btn, .filters, .pagination { display: none !important; }
    .dashboard-main { margin-left: 0 !important; }
    body { background: #fff; }
}

/* === Responsive Table === */
@media (max-width: 768px) {
    table { font-size: 0.85rem; }
    th, td { padding: 8px 10px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === Service enquiry form === */
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%235d6d7e'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: #1a5276; }
