/* =============================================================
   MFF Portal — Base Stylesheet
   portal.myfinancefoundation.com
   
   Brand aligned with myfinancefoundation.com (v15)
   ============================================================= */

/* ===== Design Tokens ===== */
:root {
    /* Brand Colors */
    --mff-primary: #7E32DC;
    --mff-secondary: #BC44DD;
    --mff-gold: #ffd700;
    --mff-dark: #1a0a2e;
    --mff-body: #5c5470;
    --mff-light: #faf7ff;
    --mff-cream: #fff8e8;
    --mff-border: rgba(126, 50, 220, 0.15);
    
    /* Signature Gradient */
    --mff-gradient: linear-gradient(135deg, #7E32DC 0%, #BC44DD 100%);
    --mff-gradient-rich: linear-gradient(135deg, #7E32DC 0%, #9D38DD 50%, #BC44DD 100%);
    --mff-gradient-soft: linear-gradient(135deg, rgba(126,50,220,0.08) 0%, rgba(188,68,221,0.08) 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(126, 50, 220, 0.08);
    --shadow-md: 0 4px 20px rgba(126, 50, 220, 0.15);
    --shadow-lg: 0 12px 40px rgba(126, 50, 220, 0.2);
    --shadow-button: 0 4px 20px rgba(126, 50, 220, 0.35);
    
    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', sans-serif;
    --font-display: Georgia, serif;
    
    /* Spacing */
    --container-max: 1200px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 100px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: #ffffff;
    color: var(--mff-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--mff-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--mff-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Layout ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header (Top Navigation) ===== */
.portal-header {
    background: #ffffff;
    border-bottom: 1px solid var(--mff-border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.portal-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.portal-logo-img {
    width: 44px;
    height: 44px;
    background: var(--mff-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 22px;
    box-shadow: var(--shadow-sm);
}

.portal-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.portal-logo-title {
    font-weight: 700;
    color: var(--mff-dark);
    font-size: 15px;
    letter-spacing: -0.3px;
}

.portal-logo-tagline {
    font-size: 11px;
    color: var(--mff-body);
    font-style: italic;
}

.portal-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--mff-gradient);
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(126, 50, 220, 0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--mff-primary);
    border: 2px solid var(--mff-primary);
}

.btn-outline:hover {
    background: var(--mff-primary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--mff-body);
}

.btn-ghost:hover {
    color: var(--mff-primary);
    background: var(--mff-light);
}

.btn-large {
    padding: 16px 36px;
    font-size: 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===== Hero / Landing Section ===== */
.hero-section {
    background: var(--mff-gradient-soft);
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(188, 68, 221, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(126, 50, 220, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--mff-primary);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.hero-headline {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--mff-dark);
    margin-bottom: 24px;
}

.hero-headline .accent {
    background: var(--mff-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtext {
    font-size: 18px;
    color: var(--mff-body);
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Feature Cards ===== */
.features-section {
    padding: 80px 0;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    text-align: center;
    color: var(--mff-dark);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    text-align: center;
    color: var(--mff-body);
    font-size: 17px;
    margin-bottom: 48px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-card {
    background: white;
    border: 1px solid var(--mff-border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--mff-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: white;
    box-shadow: var(--shadow-sm);
}

.feature-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mff-dark);
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--mff-body);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== Forms (Base styles, refined per page) ===== */
.form-container {
    max-width: 480px;
    margin: 60px auto;
    padding: 0 24px;
}

.form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--mff-border);
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--mff-dark);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.form-subtitle {
    color: var(--mff-body);
    text-align: center;
    margin-bottom: 32px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--mff-dark);
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--mff-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--mff-dark);
    background: white;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--mff-primary);
    box-shadow: 0 0 0 3px rgba(126, 50, 220, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    font-size: 12px;
    color: var(--mff-body);
    margin-top: 6px;
}

.form-error {
    font-size: 13px;
    color: #d32f2f;
    margin-top: 6px;
}

/* ===== Alerts / Notifications ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-left: 4px solid #43a047;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #e53935;
}

.alert-info {
    background: var(--mff-light);
    color: var(--mff-primary);
    border-left: 4px solid var(--mff-primary);
}

.alert-warning {
    background: var(--mff-cream);
    color: #856404;
    border-left: 4px solid #f1c40f;
}

/* ===== Footer ===== */
.portal-footer {
    background: var(--mff-dark);
    color: white;
    padding: 48px 0 24px;
    margin-top: auto;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
    font-size: 20px;
    margin-bottom: 12px;
    background: var(--mff-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
}

.footer-col h4 {
    color: white;
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--mff-secondary);
}

.footer-bottom {
    padding-top: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-draft { background: #f5f5f5; color: #666; }
.status-draft::before { background: #999; }

.status-pending { background: #fff8e1; color: #f57c00; }
.status-pending::before { background: #f57c00; }

.status-active, .status-approved { background: #e8f5e9; color: #2e7d32; }
.status-active::before, .status-approved::before { background: #2e7d32; }

.status-rejected { background: #ffebee; color: #c62828; }
.status-rejected::before { background: #c62828; }

/* ===== Coming Soon / Placeholder ===== */
.coming-soon {
    text-align: center;
    padding: 100px 24px;
    max-width: 600px;
    margin: 0 auto;
}

.coming-soon-emoji {
    font-size: 80px;
    margin-bottom: 24px;
}

.coming-soon h1 {
    font-size: 36px;
    color: var(--mff-dark);
    margin-bottom: 16px;
    font-weight: 800;
}

.coming-soon p {
    color: var(--mff-body);
    font-size: 17px;
    margin-bottom: 32px;
}

/* ===== Health Check Page ===== */
.health-check {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 24px;
}

.health-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--mff-border);
}

.health-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--mff-dark);
}

.health-subtitle {
    color: var(--mff-body);
    margin-bottom: 32px;
    font-size: 15px;
}

.health-check-list {
    list-style: none;
}

.health-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--mff-border);
}

.health-check-item:last-child {
    border-bottom: none;
}

.health-check-name {
    font-weight: 600;
    color: var(--mff-dark);
}

.health-check-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.health-pass { background: #e8f5e9; color: #2e7d32; }
.health-fail { background: #ffebee; color: #c62828; }
.health-warn { background: #fff8e1; color: #f57c00; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section { padding: 50px 0 70px; }
    .hero-headline { font-size: 36px; letter-spacing: -1px; }
    .hero-subtext { font-size: 16px; }
    .hero-cta .btn { width: 100%; }
    
    .section-title { font-size: 28px; }
    .feature-grid { grid-template-columns: 1fr; gap: 20px; }
    
    .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-brand { grid-column: span 2; }
    
    .portal-nav-actions .btn { padding: 8px 14px; font-size: 13px; }
    .portal-logo-tagline { display: none; }
    
    .form-card { padding: 28px 24px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-headline { font-size: 30px; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-brand { grid-column: span 1; }
}
