/* DFY Mortgages - Responsive CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Nav */
.navbar {
    background: #1a365d; color: white; padding: 12px 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.nav-brand a { color: white; text-decoration: none; font-size: 1.3em; font-weight: 700; }
.nav-links a { color: #bee3f8; text-decoration: none; margin-left: 16px; }
.nav-links a:hover { color: white; }
.nav-user { color: #90cdf4; margin-left: 16px; font-size: 0.9em; }

/* Flash messages */
.flash { padding: 12px 16px; margin-bottom: 16px; border-radius: 6px; }
.flash-success { background: #c6f6d5; color: #22543d; }
.flash-error { background: #fed7d7; color: #742a2a; }
.flash-warning { background: #fefcbf; color: #744210; }

/* Cards */
.card {
    background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 24px; margin-bottom: 20px;
}
.card h2 { margin-bottom: 16px; color: #1a365d; }
.card h3 { margin-bottom: 12px; color: #2d3748; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568; font-size: 0.9em; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 6px;
    font-size: 1em; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #4299e1; box-shadow: 0 0 0 3px rgba(66,153,225,0.2);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Buttons */
.btn {
    display: inline-block; padding: 10px 20px; border: none; border-radius: 6px;
    font-size: 1em; cursor: pointer; text-decoration: none; text-align: center;
    transition: background 0.2s;
}
.btn-primary { background: #3182ce; color: white; }
.btn-primary:hover { background: #2b6cb0; }
.btn-success { background: #38a169; color: white; }
.btn-success:hover { background: #2f855a; }
.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-secondary { background: #718096; color: white; }
.btn-secondary:hover { background: #4a5568; }
.btn-sm { padding: 6px 12px; font-size: 0.85em; }
.btn-outline {
    background: transparent; border: 1px solid #3182ce; color: #3182ce;
}
.btn-outline:hover { background: #3182ce; color: white; }
.btn-google {
    background: white; color: #333; border: 1px solid #ddd;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-google:hover { background: #f7fafc; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #edf2f7; font-weight: 600; color: #4a5568; font-size: 0.85em; text-transform: uppercase; }
tr:hover { background: #f7fafc; }

/* Pipeline badges */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 0.8em; font-weight: 600;
}
.badge-started { background: #e2e8f0; color: #4a5568; }
.badge-progress { background: #bee3f8; color: #2b6cb0; }
.badge-complete { background: #c6f6d5; color: #22543d; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-stale { background: #fed7d7; color: #742a2a; }

/* Progress bar */
.progress-bar { background: #e2e8f0; border-radius: 10px; height: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: #38a169; border-radius: 10px; transition: width 0.3s; }

/* Wizard steps */
.wizard-steps {
    display: flex; justify-content: space-between; margin-bottom: 24px;
    list-style: none; counter-reset: step;
}
.wizard-steps li {
    flex: 1; text-align: center; position: relative; padding: 12px 4px;
    font-size: 0.85em; color: #a0aec0;
}
.wizard-steps li.active { color: #3182ce; font-weight: 700; }
.wizard-steps li.done { color: #38a169; }
.wizard-steps li::before {
    content: counter(step); counter-increment: step;
    display: block; width: 30px; height: 30px; line-height: 30px;
    border-radius: 50%; background: #e2e8f0; margin: 0 auto 6px;
    font-weight: 700;
}
.wizard-steps li.active::before { background: #3182ce; color: white; }
.wizard-steps li.done::before { background: #38a169; color: white; }

/* Document checklist */
.doc-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
    margin-bottom: 8px;
}
.doc-item.uploaded { border-color: #38a169; background: #f0fff4; }
.doc-item.missing { border-color: #e2e8f0; }
.doc-status { font-size: 1.2em; margin-right: 12px; }

/* Coaching tip */
.coaching-tip {
    background: #ebf8ff; border-left: 4px solid #3182ce;
    padding: 12px 16px; margin-bottom: 16px; border-radius: 0 6px 6px 0;
    font-size: 0.9em; color: #2b6cb0;
}

/* Auth pages */
.auth-container {
    max-width: 420px; margin: 60px auto;
}
.auth-divider {
    text-align: center; margin: 16px 0; color: #a0aec0;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: ''; position: absolute; top: 50%;
    width: 40%; height: 1px; background: #e2e8f0;
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ─── Home Screen ─── */
.home-body {
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    min-height: 100vh;
}
.home-header {
    padding: 20px 32px;
}
.home-header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.home-logo { display: flex; align-items: baseline; gap: 6px; }
.logo-dfy {
    font-size: 2em; font-weight: 800; color: #48bb78;
    letter-spacing: 2px;
}
.logo-mortgages {
    font-size: 1.4em; font-weight: 300; color: white;
}
.home-admin-btn {
    color: #a0aec0; text-decoration: none; font-size: 0.85em;
    padding: 6px 14px; border: 1px solid #4a5568; border-radius: 6px;
    transition: all 0.2s;
}
.home-admin-btn:hover { color: white; border-color: #718096; }

.home-hero {
    text-align: center; padding: 60px 20px 40px; color: white;
}
.home-hero h1 {
    font-size: 2.8em; font-weight: 700; line-height: 1.2; margin-bottom: 16px;
}
.hero-accent { color: #48bb78; }
.hero-sub {
    font-size: 1.2em; color: #cbd5e0; max-width: 600px; margin: 0 auto;
}

.home-cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; max-width: 1100px; margin: 0 auto; padding: 0 24px 60px;
}
.home-card {
    background: white; border-radius: 16px; padding: 36px 28px;
    text-decoration: none; color: #333; transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.home-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.home-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.card-borrower::before { background: #3182ce; }
.card-referrer::before { background: #48bb78; }
.card-lender::before { background: #ed8936; }

.card-icon { font-size: 2.4em; margin-bottom: 12px; }
.home-card h2 {
    font-size: 1.5em; font-weight: 700; margin-bottom: 4px; color: #1a365d;
}
.card-tagline {
    font-size: 1em; font-weight: 600; margin-bottom: 16px;
}
.card-borrower .card-tagline { color: #3182ce; }
.card-referrer .card-tagline { color: #38a169; }
.card-lender .card-tagline { color: #dd6b20; }

.home-card ul {
    list-style: none; padding: 0; margin: 0 0 20px; flex: 1;
}
.home-card li {
    padding: 8px 0; border-bottom: 1px solid #f0f0f0;
    font-size: 0.92em; color: #4a5568; line-height: 1.4;
}
.home-card li:last-child { border-bottom: none; }

.card-cta {
    font-weight: 700; font-size: 1em; margin-top: auto; padding-top: 12px;
}
.card-borrower .card-cta { color: #3182ce; }
.card-referrer .card-cta { color: #38a169; }
.card-lender .card-cta { color: #dd6b20; }

.home-footer {
    text-align: center; padding: 20px; color: #718096; font-size: 0.85em;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .wizard-steps { flex-wrap: wrap; }
    .wizard-steps li { flex: none; width: 20%; }
    .navbar { flex-direction: column; gap: 8px; }
    .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
    .home-cards { grid-template-columns: 1fr; }
    .home-hero h1 { font-size: 2em; }
    .home-hero { padding: 40px 20px 20px; }
}
