:root {
    --primary: #4a6cf7;
    --primary-dark: #3a56d4;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #333;
    --text-muted: #999;
    --border: #e8e8e8;
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ff9500;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #c6d7ef;
    color: var(--text);
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
}

.app-nav {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-phone { font-size: 13px; opacity: 0.9; }

.app-content { padding: 0; }

.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Home */
.home-container { padding: 12px; }

.survey-card-link { text-decoration: none; color: inherit; display: block; margin-bottom: 12px; }

.survey-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.survey-card:active { transform: scale(0.98); }

.card-banner {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.card-body { padding: 12px 16px; flex: 1; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.card-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-contact { font-size: 12px; color: var(--text-muted); margin-bottom: 0; }
.page-title { font-size: 16px; font-weight: 600; padding: 12px; color: var(--text); }
.record-count { font-size: 12px; color: var(--text-muted); padding: 0 12px 12px; }
.load-more-btn { width: 100%; max-width: 300px; margin: 20px auto; display: block; }
.card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.card-arrow { padding: 0 16px; color: var(--text-muted); }

/* Survey Page */
.survey-banner { width: 100%; overflow: hidden; }
.survey-banner img { width: 100%; height: 220px; object-fit: cover; }

.survey-header { padding: 20px 16px; background: var(--card-bg); margin-bottom: 12px; }
.survey-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.com-info{margin-bottom: 20px}
.info-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.survey-intro, .info-text { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; text-indent:2em; text-align:justify;}
.survey-info { display: flex; gap: 12px; font-size: 13px; color: var(--text-muted); }
.contact {display: flex; align-items: center;}
.contact .icon{margin: 0 5px 8px 0;}
.contact .info-text{text-indent:1em ;margin-bottom: 5px;}
.contact a{text-decoration: none;}
/* Question Cards */
.questions-container { padding: 0 12px 12px; }

.question-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    animation: fadeInUp 0.3s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-card:nth-child(1) { animation-delay: 0.05s; }
.question-card:nth-child(2) { animation-delay: 0.1s; }
.question-card:nth-child(3) { animation-delay: 0.15s; }
.question-card:nth-child(4) { animation-delay: 0.2s; }
.question-card:nth-child(5) { animation-delay: 0.25s; }
.question-card:nth-child(n+6) { animation-delay: 0.3s; }

.question-header { display: flex; align-items: flex-start; margin-bottom: 12px; }
.question-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}
.question-content { font-size: 15px; font-weight: 500; flex: 1; }
.required-mark { color: var(--danger); margin-left: 4px; }

/* Options */
.question-options { display: flex; flex-direction: column; gap: 8px; }

.option-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.option-item:active { transform: scale(0.98); }
.option-item input { display: none; }
.option-text { flex: 1; font-size: 14px; }
.option-check { font-size: 18px; color: var(--border); transition: color 0.2s; }

.option-radio input:checked ~ .option-check { color: var(--primary); }
.option-radio input:checked ~ .option-check i::before { content: "\f26a"; }
.option-checkbox input:checked ~ .option-check { color: var(--primary); }
.option-checkbox input:checked ~ .option-check i::before { content: "\f586"; }

.option-item:has(input:checked) {
    border-color: var(--primary);
    background: rgba(74, 108, 247, 0.05);
}

/* "Other" option styling */
.option-other-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.option-other-item .option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.option-other-item .option-text { flex: 1; font-size: 14px; }
.option-other-item .option-check { font-size: 18px; color: var(--border); transition: color 0.2s; }
.option-other-item input[type="radio"]:checked ~ .option-check,
.option-other-item input[type="checkbox"]:checked ~ .option-check { color: var(--primary); }
.other-text-input {
    margin-top: 4px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    opacity: 0.6;
}
.other-text-input:disabled {
    background: var(--bg);
    opacity: 0.6;
}
.other-text-input:not(:disabled) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
    display: block;
    opacity: 1;
}

/* Text Inputs */
.question-input {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.question-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1); }

/* Other Input */
.other-input-group { display: flex; flex-direction: column; gap: 8px; }

/* Contact Section */
.contact-section {
    background: var(--card-bg);
    border-radius: 12px;
    margin: 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.contact-toggle {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: background 0.2s;
}
.contact-toggle:active { background: var(--bg); }
#contactIcon { transition: transform 0.3s; }
#contactIcon.open { transform: rotate(180deg); }

.contact-fields { padding: 0 16px 16px; }

/* Submit */
.submit-area { padding: 12px 12px 40px; text-align: center; }

.btn-submit {
    background: var(--primary);
    border: none;
    border-radius: 25px;
    padding: 12px 48px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    width: 100%;
    max-width: 300px;
    transition: all 0.2s;
}
.btn-submit:hover { background: var(--primary-dark); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { background: var(--text-muted); cursor: not-allowed; }

/* Error Toast */
.error-toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90%;
}
.error-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Auth */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}
.auth-card h2 { margin-bottom: 8px; }

/* Success / Error Pages */
.success-container, .error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 40px 20px;
    text-align: center;
}
.success-icon { font-size: 64px; color: var(--success); margin-bottom: 16px; }
.error-icon { font-size: 64px; color: var(--warning); margin-bottom: 16px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; }
