:root {
    --primary-dark: #1D5942;
    --primary: #2A8766;
    --primary-light: #34A077;
    --white: #ffffff;
    --light-bg: #f5f9f7;
    --border: #d0e0d8;
    --text-dark: #2c3e50;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-hover: 0 8px 20px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; }
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.5;
    margin: 0;
    font-size: 14px;
}

/* ========== NAVIGATION ========== */
.top-nav {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.nav-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
}
.nav-logo { height: 40px; width: auto; }

/* Hamburger button – hidden on desktop */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary-dark);
    padding: 0 10px;
}

/* Navigation links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--primary); }
.btn-nav {
    background: var(--primary);
    color: white !important;
    padding: 8px 20px;
    border-radius: 40px;
}
.btn-nav:hover { background: var(--primary-dark); }
.nav-user {
    color: var(--primary);
    font-weight: 600;
    padding: 0 5px;
}

/* ========== MAIN CONTAINER ========== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 20px;
    min-height: calc(100vh - 160px);
}

/* ========== CARDS ========== */
.card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 30px;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }

h1, h2, h3, h4 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
    margin-bottom: 10px;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-secondary:hover {
    background: var(--primary);
    color: white;
}
.btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}
.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}
.btn-large {
    padding: 18px 42px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========== FORMS ========== */
.form-group { margin-bottom: 24px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-dark);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    background: white;
    transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
}
.form-row { display: flex; gap: 20px; }
.form-row .form-group { flex: 1; }

.step { display: none; }
.step.active { display: block; }
.step-indicator {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.nav-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ========== PROGRESS BAR ========== */
.progress-container {
    background: #e0e0e0;
    border-radius: 20px;
    height: 12px;
    margin: 20px 0 30px;
    position: relative;
}
.progress-bar {
    height: 12px;
    border-radius: 20px;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}
.progress-text {
    position: absolute;
    right: 0;
    top: -28px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* ========== QUESTION CARD ========== */
.question-card { text-align: center; }
.question-text {
    font-size: 1.5rem;
    margin-bottom: 40px;
    line-height: 1.4;
    color: var(--primary-dark);
}

/* ========== LIKERT SCALE ========== */
.likert-scale {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    gap: 15px;
}
.radio-option {
    flex: 1;
    text-align: center;
    cursor: pointer;
}
.radio-option input { display: none; }
.radio-custom {
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-radius: 50%;
    margin: 0 auto 12px;
    transition: all 0.2s;
    background: white;
}
.radio-option input:checked + .radio-custom {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(42,135,102,0.2);
}
.radio-option small {
    display: block;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
}
.radio-option:hover .radio-custom {
    border-color: var(--primary-light);
}

/* ========== RESULTS PAGE ========== */
.results-header {
    text-align: center;
    margin-bottom: 40px;
}
.results-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}
.results-header .completed-date {
    color: #666;
    font-size: 1rem;
}

.factor-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}
.factor-section:last-child { border-bottom: none; }
.factor-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}
.factor-header h3 {
    margin-bottom: 0;
    font-size: 1.8rem;
}
.factor-score-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}
.factor-bar-container {
    background: #e9ecef;
    border-radius: 20px;
    height: 20px;
    margin: 15px 0 10px;
}
.factor-bar {
    height: 20px;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
}
.factor-interpretation {
    font-style: italic;
    color: #4a5c6c;
    margin-bottom: 25px;
}

.facets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}
.facet-item {
    background: #f8fbfa;
    padding: 15px 18px;
    border-radius: 12px;
}
.facet-name {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
}
.facet-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}
.facet-bar-container {
    background: #e0e7e4;
    border-radius: 10px;
    height: 10px;
}
.facet-bar {
    height: 10px;
    border-radius: 10px;
    background: var(--primary-light);
    width: 0%;
}

.action-buttons {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ========== TABLES ========== */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.results-table th, .results-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.results-table th {
    background: var(--primary-dark);
    color: white;
    font-weight: 600;
}
.results-table tr:hover { background: #f8fbfa; }

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    color: #6c757d;
    margin-top: 20px;
}
.site-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ========== LANDING PAGE ========== */
.hero-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.hero-container {
    max-width: 900px;
    width: 100%;
    background: linear-gradient(145deg, var(--primary-dark) 0%, #1a4d38 100%);
    border-radius: 40px;
    padding: 70px 60px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 40px;
    margin-bottom: 30px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}
.hero-title {
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 25px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.hero-subtitle {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.9);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
    font-weight: 400;
}
.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-outline-light {
    background: transparent;
    border: 2px solid white;
    color: white;
}
.btn-outline-light:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.info-card {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}
.info-text { flex: 2; }
.info-image { flex: 1; text-align: center; }

/* ========== LOGIN PAGE ========== */
.login-card {
    max-width: 450px;
    margin: 40px auto;
}
.login-note {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

/* ========== ADMIN DASHBOARD ========== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
.avg-scores {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.avg-item {
    display: flex;
    align-items: center;
    gap: 15px;
}
.avg-item span {
    width: 150px;
    font-weight: 600;
}
.avg-bar-container {
    flex: 1;
    background: #e9ecef;
    border-radius: 20px;
    height: 24px;
}
.avg-bar {
    height: 24px;
    border-radius: 20px;
    background: var(--primary);
    color: white;
    line-height: 24px;
    padding: 0 10px;
    font-weight: 600;
    min-width: 40px;
}
.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}
.member-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.registration-summary {
    background: #f8fbfa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.info-item {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}
.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1.5px solid var(--border);
    border-radius: 40px;
}
.actions-cell {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}
.pagination a {
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
}
.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination a:hover {
    background: var(--primary-light);
    color: white;
}
.table-responsive {
    overflow-x: auto;
}

/* Edit Form Sections */
.form-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.form-section {
    background: #f8fbfa;
    padding: 20px;
    border-radius: 12px;
}
.form-section h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}
.form-section h4 {
    margin: 15px 0 10px;
    color: var(--primary-dark);
}
.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/* Admin Results Facets */
.factor-section-admin { margin-bottom: 30px; }
.factor-header-admin h4 { margin-bottom: 5px; color: var(--primary-dark); }
.facets-grid-admin {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}
.facet-item-admin {
    background: #f5f9f7;
    padding: 10px 12px;
    border-radius: 8px;
}
.facet-name-admin {
    font-weight: 600;
    color: var(--primary-dark);
}
.facet-score-admin {
    float: right;
    font-weight: 700;
    color: var(--primary);
}
.facet-bar-container-admin {
    background: #d0e0d8;
    border-radius: 8px;
    height: 8px;
    margin-top: 5px;
    clear: both;
}
.facet-bar-admin {
    height: 8px;
    border-radius: 8px;
    background: var(--primary-light);
}

/* ========== MOBILE STYLES ========== */
@media (max-width: 768px) {
    body { font-size: 14px; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }

    /* Hamburger menu */
    .hamburger {
        display: block;
    }
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    .nav-brand {
        flex: 1;
    }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px 0 5px;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-link {
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }
    .nav-link:last-child { border-bottom: none; }
    .btn-nav {
        display: inline-block;
        width: auto;
    }
    .nav-user {
        width: 100%;
        padding: 8px 0;
    }

    .hero-container { padding: 40px 20px; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }

    .btn { padding: 10px 18px; font-size: 14px; width: 100%; margin-right: 0; }
    .btn-large { padding: 14px 24px; font-size: 1rem; }
    .hero-buttons .btn { width: auto; }

    .card { padding: 20px 15px; }

    .form-row { flex-direction: column; gap: 0; }
    .form-group input, .form-group select, .form-group textarea {
        padding: 12px 14px;
        font-size: 16px;
    }

    .question-text { font-size: 1.2rem; }
    .likert-scale { flex-wrap: wrap; }
    .radio-option { min-width: 65px; }
    .radio-option small { font-size: 0.7rem; }

    .facets-grid { grid-template-columns: 1fr; }
    .trait-name { font-size: 1.1rem; }
    .trait-score { font-size: 2rem; }

    .dashboard-stats { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-sections { grid-template-columns: 1fr; }

    .results-table { font-size: 12px; }
    .results-table th, .results-table td { padding: 8px 4px; }

    .info-card { flex-direction: column; }
    .member-header { flex-direction: column; align-items: flex-start; }
    .member-actions { width: 100%; }
    .member-actions .btn { flex: 1; text-align: center; }
    .info-grid { grid-template-columns: 1fr; }
    .admin-actions { flex-direction: column; }
    .search-form { width: 100%; max-width: none; }
}