/* ==========================================================================
   ChurchTools Reporter – Frontend Styles
   Farbschema: Lila/Violett (kirchlich, warm, seriös)
   ========================================================================== */

:root {
    --ctr-primary: #7c3aed;
    --ctr-primary-dark: #6d28d9;
    --ctr-primary-light: #f5f3ff;
    --ctr-secondary: #059669;
    --ctr-text: #1e293b;
    --ctr-text-light: #64748b;
    --ctr-bg: #f8fafc;
    --ctr-white: #ffffff;
    --ctr-border: #e2e8f0;
    --ctr-radius: 12px;
    --ctr-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --ctr-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* Reset */
.ctr-site * { box-sizing: border-box; }
.ctr-site { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ctr-text); }
.ctr-site h1, .ctr-site h2, .ctr-site h3 { font-weight: 700; line-height: 1.2; }

/* Container */
.ctr-container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ====== Header ====== */
.ctr-header {
    background: var(--ctr-white);
    border-bottom: 1px solid var(--ctr-border);
    padding: 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.ctr-header .ctr-container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.ctr-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ctr-text); font-weight: 700; font-size: 18px; }
.ctr-logo-icon { font-size: 28px; }
.ctr-nav { display: flex; align-items: center; gap: 24px; }
.ctr-nav a { text-decoration: none; color: var(--ctr-text-light); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.ctr-nav a:hover { color: var(--ctr-primary); }
.ctr-nav-buttons { display: flex; gap: 8px; }

/* Mobile Menu */
.ctr-menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.ctr-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--ctr-text); margin: 5px 0; transition: 0.3s; }
.ctr-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
.ctr-nav-overlay.open { display: block; }

@media (max-width: 768px) {
    .ctr-menu-toggle { display: block; }
    .ctr-nav { display: none; position: fixed; top: 64px; right: 0; width: 280px; height: calc(100vh - 64px); background: var(--ctr-white); flex-direction: column; padding: 24px; z-index: 100; box-shadow: var(--ctr-shadow-lg); }
    .ctr-nav.open { display: flex; }
    .ctr-nav-buttons { flex-direction: column; width: 100%; }
    .ctr-nav-buttons .ctr-btn { text-align: center; }
}

/* ====== Buttons ====== */
.ctr-btn {
    display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
    text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: all 0.2s;
    line-height: 1.4;
}
.ctr-btn-primary { background: var(--ctr-primary); color: #fff !important; border-color: var(--ctr-primary); }
.ctr-btn-primary:hover { background: var(--ctr-primary-dark); border-color: var(--ctr-primary-dark); }
.ctr-btn-outline { background: transparent; color: var(--ctr-primary) !important; border-color: var(--ctr-primary); }
.ctr-btn-outline:hover { background: var(--ctr-primary-light); }
.ctr-btn-white { background: var(--ctr-white); color: var(--ctr-primary) !important; border-color: var(--ctr-white); }
.ctr-btn-white:hover { background: #f1f5f9; }
.ctr-btn-sm { padding: 6px 14px; font-size: 13px; }
.ctr-btn-lg { padding: 14px 28px; font-size: 16px; }
.ctr-btn-full { width: 100%; text-align: center; }
.ctr-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ====== Hero ====== */
.ctr-hero { background: linear-gradient(135deg, var(--ctr-primary-light) 0%, #ede9fe 50%, #e0e7ff 100%); padding: 80px 0; }
.ctr-hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.ctr-hero-badge { display: inline-block; background: var(--ctr-primary); color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.ctr-hero h1 { font-size: 42px; margin: 0 0 16px; color: var(--ctr-text); }
.ctr-hero .lead { font-size: 18px; color: var(--ctr-text-light); line-height: 1.6; margin: 0 0 28px; }
.ctr-hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.ctr-hero-trust { margin-top: 20px; font-size: 13px; color: var(--ctr-text-light); }

/* Hero Visual (Demo Card) */
.ctr-hero-card { background: var(--ctr-white); border-radius: var(--ctr-radius); box-shadow: var(--ctr-shadow-lg); overflow: hidden; }
.ctr-hero-card-header { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--ctr-border); }
.ctr-hero-dot { width: 10px; height: 10px; border-radius: 50%; }
.ctr-hero-dot.red { background: #ef4444; }
.ctr-hero-dot.yellow { background: #f59e0b; }
.ctr-hero-dot.green { background: #22c55e; }
.ctr-hero-card-body { padding: 20px; }
.ctr-hero-stat-row { display: flex; gap: 16px; margin-bottom: 20px; }
.ctr-hero-mini-stat { text-align: center; flex: 1; }
.ctr-hero-mini-stat .num { font-size: 28px; font-weight: 800; color: var(--ctr-primary); }
.ctr-hero-mini-stat .label { font-size: 11px; color: var(--ctr-text-light); text-transform: uppercase; }
.ctr-hero-chart-placeholder { display: flex; gap: 8px; align-items: flex-end; height: 80px; }
.ctr-hero-chart-placeholder .bar { flex: 1; background: linear-gradient(to top, var(--ctr-primary), #a78bfa); border-radius: 4px 4px 0 0; min-height: 10px; }

@media (max-width: 768px) {
    .ctr-hero { padding: 50px 0; }
    .ctr-hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .ctr-hero h1 { font-size: 30px; }
}

/* ====== Features ====== */
.ctr-features { padding: 80px 0; background: var(--ctr-white); }
.ctr-section-title { text-align: center; font-size: 32px; margin: 0 0 8px; }
.ctr-section-subtitle { text-align: center; font-size: 16px; color: var(--ctr-text-light); margin: 0 0 48px; }
.ctr-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ctr-feature-card {
    background: var(--ctr-bg); border: 1px solid var(--ctr-border); border-radius: var(--ctr-radius);
    padding: 28px; transition: transform 0.2s, box-shadow 0.2s;
}
.ctr-feature-card:hover { transform: translateY(-4px); box-shadow: var(--ctr-shadow-lg); }
.ctr-feature-icon { font-size: 36px; margin-bottom: 12px; }
.ctr-feature-card h3 { font-size: 18px; margin: 0 0 8px; }
.ctr-feature-card p { font-size: 14px; color: var(--ctr-text-light); line-height: 1.5; margin: 0; }

@media (max-width: 768px) { .ctr-features-grid { grid-template-columns: 1fr; } }

/* ====== Reports Preview ====== */
.ctr-reports-preview { padding: 80px 0; background: var(--ctr-bg); }
.ctr-reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.ctr-report-card {
    background: var(--ctr-white); border: 1px solid var(--ctr-border); border-radius: var(--ctr-radius);
    padding: 24px; text-align: center;
}
.ctr-report-icon { font-size: 40px; margin-bottom: 12px; }
.ctr-report-card h3 { font-size: 16px; margin: 0 0 8px; }
.ctr-report-card p { font-size: 13px; color: var(--ctr-text-light); margin: 0; }

/* ====== CTA ====== */
.ctr-cta { padding: 80px 0; background: linear-gradient(135deg, var(--ctr-primary), #6d28d9); }
.ctr-cta-inner { text-align: center; }
.ctr-cta h2 { font-size: 32px; color: #fff; margin: 0 0 12px; }
.ctr-cta p { font-size: 18px; color: rgba(255,255,255,0.8); margin: 0 0 28px; }

/* ====== Contact ====== */
.ctr-contact { padding: 60px 0; background: var(--ctr-white); }
.ctr-contact-inner { text-align: center; max-width: 500px; margin: 0 auto; }
.ctr-contact h2 { font-size: 28px; margin: 0 0 12px; }
.ctr-contact-info { display: flex; justify-content: center; gap: 30px; margin-top: 24px; }
.ctr-contact-item { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ctr-contact-item a { color: var(--ctr-primary); text-decoration: none; }

/* ====== Auth (Login/Register) ====== */
.ctr-auth { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--ctr-bg); }
.ctr-auth-card { background: var(--ctr-white); border-radius: var(--ctr-radius); box-shadow: var(--ctr-shadow-lg); padding: 40px; max-width: 440px; width: 100%; }
.ctr-auth-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.ctr-auth-card h1 { text-align: center; font-size: 24px; margin: 0 0 4px; }
.ctr-auth-subtitle { text-align: center; color: var(--ctr-text-light); font-size: 14px; margin: 0 0 28px; }
.ctr-auth-footer { text-align: center; font-size: 14px; color: var(--ctr-text-light); margin-top: 20px; }
.ctr-auth-footer a { color: var(--ctr-primary); text-decoration: none; font-weight: 600; }

/* Forms */
.ctr-form-group { display: flex; flex-direction: column; margin-bottom: 16px; }
.ctr-form-group label { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ctr-text); }
.ctr-form-group small { font-size: 12px; color: var(--ctr-text-light); margin-top: 4px; }
.ctr-form-group input, .ctr-select {
    padding: 10px 14px; border: 1px solid var(--ctr-border); border-radius: 8px;
    font-size: 14px; font-family: inherit; transition: border-color 0.2s;
}
.ctr-form-group input:focus, .ctr-select:focus { outline: none; border-color: var(--ctr-primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.ctr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .ctr-form-row { grid-template-columns: 1fr; } }

/* Auth Tabs (Login vs Token) */
.ctr-auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--ctr-border); }
.ctr-auth-tab {
    background: none; border: none; padding: 10px 20px; font-size: 14px; font-weight: 600;
    color: var(--ctr-text-light); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all 0.2s; font-family: inherit;
}
.ctr-auth-tab:hover { color: var(--ctr-primary); }
.ctr-auth-tab.active { color: var(--ctr-primary); border-bottom-color: var(--ctr-primary); }

/* Alerts */
.ctr-alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.ctr-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ctr-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.ctr-alert-info { background: #f0f9ff; color: #0c4a6e; border: 1px solid #7dd3fc; }

/* ====== Dashboard ====== */
.ctr-dashboard { padding: 40px 0 80px; background: var(--ctr-bg); min-height: 100vh; }
.ctr-dashboard-header h1 { font-size: 28px; margin: 0 0 4px; }
.ctr-dashboard-subtitle { color: var(--ctr-text-light); font-size: 14px; margin: 0 0 28px; }

.ctr-card { background: var(--ctr-white); border: 1px solid var(--ctr-border); border-radius: var(--ctr-radius); padding: 24px; margin-bottom: 20px; }
.ctr-card h2 { font-size: 18px; margin: 0 0 12px; }

/* Report Tiles */
.ctr-reports-grid-dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ctr-report-tile {
    background: var(--ctr-white); border: 1px solid var(--ctr-border); border-radius: var(--ctr-radius);
    padding: 20px; transition: box-shadow 0.2s;
}
.ctr-report-tile:hover { box-shadow: var(--ctr-shadow); }
.ctr-report-tile-icon { font-size: 32px; margin-bottom: 8px; }
.ctr-report-tile h3 { font-size: 16px; margin: 0 0 6px; }
.ctr-report-tile p { font-size: 13px; color: var(--ctr-text-light); margin: 0 0 12px; }
.ctr-report-tile-actions { display: flex; gap: 8px; }

/* Dashboard Stats */
.ctr-dashboard-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.ctr-dash-stat {
    background: var(--ctr-primary-light); border: 1px solid #ddd6fe; border-radius: 10px;
    padding: 16px 20px; text-align: center; min-width: 120px;
}
.ctr-dash-stat .icon { font-size: 24px; margin-bottom: 4px; }
.ctr-dash-stat .num { font-size: 24px; font-weight: 800; color: var(--ctr-primary); }
.ctr-dash-stat .label { font-size: 12px; color: var(--ctr-text-light); margin-top: 2px; }

/* Data Table */
.ctr-data-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.ctr-data-table th { background: var(--ctr-bg); padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--ctr-border); }
.ctr-data-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; }
.ctr-data-table tr:hover td { background: #faf5ff; }

/* Loading */
.ctr-loading-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex;
    align-items: center; justify-content: center; z-index: 9999;
}
.ctr-loading-spinner { background: var(--ctr-white); border-radius: var(--ctr-radius); padding: 40px 50px; text-align: center; box-shadow: var(--ctr-shadow-lg); }
.ctr-spinner {
    width: 40px; height: 40px; border: 4px solid #e5e7eb; border-top-color: var(--ctr-primary);
    border-radius: 50%; animation: ctr-spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes ctr-spin { to { transform: rotate(360deg); } }

/* ====== Footer ====== */
.ctr-footer { background: #1e1b4b; color: #c4b5fd; padding: 40px 0 20px; }
.ctr-footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 24px; margin-bottom: 24px; }
.ctr-footer-logo { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.ctr-footer-brand p { font-size: 13px; margin: 0; }
.ctr-footer-links { display: flex; gap: 20px; }
.ctr-footer-links a { color: #c4b5fd; text-decoration: none; font-size: 14px; }
.ctr-footer-links a:hover { color: #fff; }
.ctr-footer-bottom { display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid #312e81; font-size: 12px; flex-wrap: wrap; gap: 8px; }
.ctr-footer-bottom a { color: #c4b5fd; text-decoration: none; }
