/* Reset / base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    background-color: #f3f5f7;
    color: #1f2933;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

/* AUTH (login) layout */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.auth-logo {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 0.5rem;
}

.auth-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.auth-alert {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

/* Form elements */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.form-label {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #4b5563;
}

.form-input {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    padding: 0.6rem 1.3rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease;
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.btn-small {
    padding: 0.25rem 0.55rem;
    background: #e5e7eb;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #111827;
    text-decoration: none;
    margin-right: 4px;
}

.btn-small:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.btn-danger:hover {
    background: #b91c1c !important;
}

.text-muted {
    color: #9ca3af;
}

/* App shell */
.app-shell {
    min-height: 100vh;
    display: flex;
    background: #f3f5f7;
}

.sidebar {
    width: 240px;
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1rem;
}

.sidebar-brand {
    margin-bottom: 1.5rem;
}

.sidebar-logo {
    font-weight: 800;
    letter-spacing: 0.18em;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.sidebar-nav {
    flex: 1;
    margin-top: 0.75rem;
}

.sidebar-section-title {
    margin: 1rem 0 0.35rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-link:hover {
    background: #1f2937;
}

.sidebar-link.active {
    background: #2563eb;
    color: #ffffff;
}

.sidebar-footer {
    border-top: 1px solid #1f2937;
    padding-top: 0.85rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.9rem;
}

.sidebar-user-label {
    font-size: 0.75rem;
    color: #9ca3af;
}

.sidebar-logout-link {
    display: inline-flex;
    font-size: 0.85rem;
    color: #f97373;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.topbar-user {
    font-size: 0.9rem;
    color: #4b5563;
}

.content {
    padding: 1.5rem;
    flex: 1;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.simple-list {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.profile-card h2 {
    margin-bottom: 1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
}

.profile-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.1rem;
}

.profile-value {
    font-size: 0.95rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table thead {
    background: #f3f4f6;
}

.footer {
    border-top: 1px solid #e5e7eb;
    padding: 0.7rem 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .app-shell {
        flex-direction: column;
    }
}

@media print {
    .sidebar,
    header,
    footer {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
    }
}

/* ================================
   SURVEY FORM UI IMPROVEMENTS
   ================================ */

/* Survey container spacing */
.survey-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
}

/* Each question block */
.survey-form .form-group {
    background: #ffffff;
    padding: 18px 20px;
    margin-bottom: 18px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Question labels */
.survey-form .form-label {
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

/* Inputs */
.survey-form .form-input {
    width: 100%;
    max-width: 480px;     /* prevents stretching on desktop */
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

/* Date input narrower */
.survey-form .form-input[type="date"] {
    max-width: 240px;
}

/* Textarea */
.survey-form textarea.form-input {
    height: 120px;
    resize: vertical;
}

/* Radio / Checkbox groups */
.survey-form label {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.survey-form input[type="radio"],
.survey-form input[type="checkbox"] {
    margin-right: 6px;
}

/* Section headers */
.survey-form h3 {
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

/* Submit Button */
.survey-form button.btn-primary {
    font-size: 1.1rem;
    padding: 12px 26px;
    border-radius: 8px;
    margin-top: 10px;
    display: inline-block;
}

/* Matrix table styling */
.survey-form table.admin-table {
    width: auto;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.survey-form table.admin-table th,
.survey-form table.admin-table td {
    padding: 10px 12px;
    text-align: center;
}

/* Responsive layout fixes */
@media (max-width: 600px) {
    .survey-form .form-input {
        max-width: 100%;
    }
}

/* =======================
   THEME PREVIEW UI
   ======================= */

.theme-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 15px;
}

.theme-card {
    width: 150px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
    transition: 0.2s ease;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.theme-card.active {
    border-color: #2a8eeb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.theme-thumb {
    height: 90px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/*** thumbnail colors to match themes ***/
.vaisef-thumb     { background: linear-gradient(135deg, #333941, #004aad); }
.light-thumb      { background: #f5f5f5; border: 1px solid #ddd; }
.dark-thumb       { background: #1a1a1a; }
.blue-thumb       { background: linear-gradient(135deg, #427bff, #2357c4); }
.green-thumb      { background: linear-gradient(135deg, #34a853, #1f7a3b); }
.contrast-thumb   { background: black; border: 2px solid #ff0; }

.theme-thumb-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 6px;
}

.theme-color-swatch {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* These reuse existing color blocks */
.vaisef-thumb     { background: linear-gradient(135deg, #333941, #004aad); }
.light-thumb      { background: #f5f5f5; border: 1px solid #ddd; }
.dark-thumb       { background: #1a1a1a; }
.blue-thumb       { background: #427bff; }
.green-thumb      { background: #34a853; }
.contrast-thumb   { background: #000; border: 2px solid #ff0; }

/* Grouping display */
.group-results ul {
    margin-top: 4px;
    margin-bottom: 8px;
}
.group-results li {
    margin-bottom: 2px;
    
}

/* Grouped (multi-part) survey question formatting */
.group-question-fields {
    margin-left: 25px;
    padding-left: 10px;
    border-left: 2px solid #ddd;
}

.group-field-row,
.group-field-checkbox,
.group-field-radio {
    margin-bottom: 10px;
}

.group-field-checkbox label,
.group-field-radio label {
    font-weight: normal;
}

.group-result-block {
    margin-left: 25px;
}

.group-question-fields .group-field-row {
    margin-left: 1.5rem;
}





