/* PREDUKA 2.0 — Design System */
:root {
    --primary: #2D7A5F;
    --primary-dark: #1E5A44;
    --primary-light: #E8F5EE;
    --accent: #E8913A;
    --accent-light: #FEF3E8;
    --bg: #FDF6EE;
    --bg-card: #fff;
    --text: #2C3E2F;
    --text-muted: #5A6B5E;
    --border: #E8E0D4;
    --red: #D94040;
    --orange: #E8913A;
    --green: #2D7A5F;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(45,122,95,0.08);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar { background: rgba(253,246,238,0.95); backdrop-filter: blur(20px); padding: 14px 32px; box-shadow: 0 1px 12px rgba(45,122,95,0.06); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { width: 36px; height: 36px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; }
.logo-text { font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; color: var(--primary-dark); }
.logo-badge { font-size: 11px; background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-name { font-size: 14px; font-weight: 500; color: var(--text); }

/* Container */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 32px; padding-bottom: 60px; flex: 1; }

/* Typography */
.heading-lg { font-family: 'DM Serif Display', Georgia, serif; font-size: 28px; color: var(--primary-dark); margin-bottom: 8px; }
.heading-md { font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; color: var(--primary-dark); margin-bottom: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 28px; border-radius: var(--radius); font-weight: 600; font-size: 15px; border: none; cursor: pointer; font-family: inherit; text-decoration: none; transition: all 0.2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 8px; }
.btn-sm.btn-primary { background: var(--primary); color: #fff; text-decoration: none; }
.btn-sm.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); text-decoration: none; }
.btn-sm.btn-accent { background: var(--accent); color: #fff; text-decoration: none; }

/* Alerts */
.alert { padding: 14px 20px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; font-size: 14px; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* Auth pages */
.auth-page { display: flex; justify-content: center; padding-top: 40px; }
.auth-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow); width: 100%; max-width: 420px; }
.auth-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 28px; color: var(--primary-dark); text-align: center; margin-bottom: 8px; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 28px; }
.auth-links { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-muted); }
.auth-links a { color: var(--primary); font-weight: 500; }
.auth-links p { margin-top: 8px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-input, .form-select { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; font-family: inherit; transition: border-color 0.2s; background: #fff; }
.form-group input:focus, .form-input:focus, .form-select:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Sections */
.section { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; margin-top: 24px; box-shadow: var(--shadow); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #888; border-bottom: 2px solid var(--border); }
.data-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.data-table tr:hover { background: #f8f9fa; }

/* Badges */
.badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active { background: var(--primary); color: #fff; }
.badge-pending { background: var(--accent); color: #fff; }
.badge-none { background: #eceff1; color: #607d8b; }
.badge-required { color: var(--red); font-size: 12px; }
.badge-optional { color: var(--text-muted); font-size: 12px; }
.kod { font-family: monospace; background: var(--primary-light); padding: 3px 8px; border-radius: 4px; font-weight: 600; color: var(--primary); }

/* Survey list (rodic dashboard) */
.survey-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.survey-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.survey-card.survey-done { opacity: 0.85; }
.survey-info { flex: 1; }
.survey-short { font-family: 'DM Serif Display', Georgia, serif; font-size: 18px; color: var(--primary-dark); }
.survey-name { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* Survey form */
.survey-page { max-width: 700px; margin: 0 auto; }
.question-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.question-text { font-weight: 500; margin-bottom: 12px; font-size: 15px; }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 0.15s; }
.radio-label:hover { background: var(--primary-light); }
.radio-label input[type="radio"] { accent-color: var(--primary); }
.radio-group-inline { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.radio-num { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.radio-num input { accent-color: var(--primary); }
.radio-num span { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* PPC */
.ppc-row { display: flex; flex-direction: column; gap: 12px; }
.ppc-exists { display: flex; gap: 16px; }
.ppc-severity { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* PSC */
.psc-scale { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.psc-anchor { font-size: 12px; color: var(--text-muted); max-width: 120px; text-align: center; }

/* CSQ */
.csq-anchors { display: flex; justify-content: space-between; margin-bottom: 8px; }

/* Slider (PTL) */
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider { flex: 1; accent-color: var(--primary); height: 6px; }
.slider-value { font-weight: 700; color: var(--primary); min-width: 30px; text-align: center; }

/* Results */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.result-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.result-card.result-main { grid-column: 1 / -1; background: var(--primary-dark); color: #fff; }
.result-card.result-main .result-label { color: rgba(255,255,255,0.7); }
.result-card.result-main .result-value { color: #fff; font-size: 48px; }
.result-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.result-value { font-size: 32px; font-weight: 700; color: var(--primary); margin: 8px 0; }
.result-cat { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px; display: inline-block; }
.result-cat-green { background: #D1FAE5; color: #065F46; }
.result-cat-orange { background: #FEF3C7; color: #92400E; }
.result-cat-red { background: #FEE2E2; color: #991B1B; }

/* Empty state */
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* Back link */
.back-link { color: var(--primary); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 12px; }
.back-link:hover { text-decoration: underline; }

/* Footer */
.footer { padding: 24px; text-align: center; font-size: 13px; color: var(--text-muted); margin-top: auto; }
.footer a { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 12px 16px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .survey-card { flex-direction: column; align-items: flex-start; }
    .results-grid { grid-template-columns: 1fr 1fr; }
    .psc-scale { flex-direction: column; }
    .auth-card { padding: 24px; margin: 0 8px; }
}
