/* MediCaddy Skin Analysis Questionnaire — Google Forms–inspired responsive layout */

:root {
    --gf-bg: #f0ebf8;
    --gf-card: #ffffff;
    --gf-border: #dadce0;
    --gf-blue: #1a73e8;
    --gf-section: #673ab7;
    --gf-section-alt: #5e35b1;
    --gf-text: #202124;
    --gf-hint: #5f6368;
    --gf-error: #d93025;
    --gf-req: #d93025;
    --gf-radius: 8px;
    --gf-maxw: 760px;
    --font-stack: 'Roboto', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

body.survey-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-stack);
    font-size: 14px;
    color: var(--gf-text);
    background: var(--gf-bg);
    line-height: 1.5;
}

.survey-skip-link {
    position: absolute;
    left: -9999px;
    z-index: 100001;
    padding: 8px 16px;
    background: var(--gf-blue);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.survey-skip-link:focus {
    left: 12px;
    top: 12px;
}

.survey-shell {
    max-width: var(--gf-maxw);
    margin: 0 auto;
    padding: 24px 16px 120px;
}

/* Header card (every step) */
.survey-header-card {
    background: var(--gf-card);
    border-radius: var(--gf-radius) var(--gf-radius) 0 0;
    border: 1px solid var(--gf-border);
    border-bottom: none;
    padding: 24px 24px 20px;
    border-top: 10px solid var(--gf-blue);
}

.survey-main-title {
    margin: 0 0 8px;
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 400;
    line-height: 1.25;
}

.survey-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gf-hint);
}

.survey-meta-row a {
    color: var(--gf-blue);
    text-decoration: none;
}

.survey-meta-row a:hover {
    text-decoration: underline;
}

/* Step visibility */
.survey-step {
    display: none;
}

.survey-step.is-active {
    display: block;
}

/* Cards stack */
.survey-card {
    background: var(--gf-card);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    padding: 22px 24px;
    margin-bottom: 12px;
}

.survey-card + .survey-card {
    border-radius: var(--gf-radius);
}

.survey-header-card + .survey-section-bar {
    margin-top: 0;
}

/* Section title bar */
.survey-section-bar {
    background: var(--gf-section);
    color: #fff;
    padding: 12px 24px;
    margin: 0 0 12px;
    border-radius: var(--gf-radius);
    font-size: 15px;
    font-weight: 500;
}

/* Questions */
.survey-q-label {
    display: block;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 8px;
}

.survey-q-label .req {
    color: var(--gf-req);
}

.survey-q-hint {
    display: block;
    font-size: 13px;
    font-style: italic;
    color: var(--gf-hint);
    margin-bottom: 12px;
    font-weight: 400;
}

.survey-input-text,
.survey-input-date,
.survey-input-other {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    border: none;
    border-bottom: 1px solid var(--gf-border);
    background: transparent;
    border-radius: 4px 4px 0 0;
    transition: background 0.15s ease;
}

.survey-input-text:hover,
.survey-input-date:hover,
.survey-input-other:hover {
    background: #f8f9fa;
}

.survey-input-text:focus,
.survey-input-date:focus,
.survey-input-other:focus {
    outline: none;
    border-bottom-color: var(--gf-section);
    background: #f3e5f5;
}

.survey-option-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.survey-option-list li {
    margin-bottom: 10px;
}

.survey-radio-label,
.survey-check-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.45;
}

.survey-radio-label input,
.survey-check-label input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--gf-section);
}

/* Linear scale */
.survey-scale-wrap {
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.survey-scale {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: space-between;
    min-width: min(100%, 640px);
    margin: 0 auto;
}

.survey-scale-num {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 36px;
}

.survey-scale-num label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--gf-hint);
    white-space: nowrap;
}

.survey-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--gf-hint);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.survey-scale-num input {
    accent-color: var(--gf-section);
}

/* Intro */
.survey-intro-lead {
    font-size: 15px;
    margin: 0 0 12px;
}

.survey-intro-lead strong {
    font-weight: 600;
}

.survey-intro-time {
    font-size: 14px;
    margin: 16px 0;
}

.survey-meta-row--privacy {
    margin-top: 10px;
    font-size: 13px;
    color: var(--gf-hint);
    gap: 6px;
}

.survey-meta-dot {
    opacity: 0.5;
}

.survey-card--intro-copy {
    margin-top: 12px;
}

.survey-intro-visual {
    margin: 20px 0 0;
    border-radius: var(--gf-radius);
    overflow: hidden;
    border: 1px solid var(--gf-border);
    background: #fafafa;
}

.survey-intro-visual img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Agreement */
.survey-agree-info {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.survey-agree-info ul.purpose-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.survey-agree-info .purpose-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
}

.survey-agree-info .purpose-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    background: #34a853;
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    border-radius: 2px;
}

.survey-checkbox-row {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gf-border);
}

/* Footer nav */
.survey-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--gf-bg);
    border-top: 1px solid var(--gf-border);
    padding: 12px 16px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.survey-footer-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.survey-btn {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 22px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--gf-border);
    background: var(--gf-card);
    color: var(--gf-text);
    min-height: 36px;
}

.survey-btn:hover {
    background: #f8f9fa;
}

.survey-btn:focus-visible {
    outline: 2px solid var(--gf-blue);
    outline-offset: 2px;
}

.survey-btn--primary {
    background: var(--gf-section);
    color: #fff;
    border-color: var(--gf-section);
}

.survey-btn--primary:hover {
    background: var(--gf-section-alt);
    border-color: var(--gf-section-alt);
}

.survey-btn--link {
    background: none;
    border: none;
    color: var(--gf-purple, #673ab7);
    padding: 8px 12px;
    text-decoration: none;
}

.survey-btn--link:hover {
    text-decoration: underline;
    background: transparent;
}

.survey-progress {
    font-size: 13px;
    color: var(--gf-hint);
    width: 100%;
    text-align: center;
    order: -1;
}

@media (min-width: 600px) {
    .survey-progress {
        width: auto;
        order: 0;
        flex: 1;
        text-align: center;
    }

    .survey-footer {
        padding-left: calc(50% - var(--gf-maxw) / 2);
        padding-right: calc(50% - var(--gf-maxw) / 2);
    }
}

.survey-field-error {
    color: var(--gf-error);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.survey-field-error.is-visible {
    display: block;
}

.survey-card.has-error {
    border-color: var(--gf-error);
}

/* Other + text inline */
.survey-other-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    margin-left: 30px;
}

.survey-other-row .survey-input-other {
    flex: 1;
    min-width: 160px;
}

/* Loading overlay */
.survey-loading {
    position: fixed;
    inset: 0;
    z-index: 100002;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.survey-loading.is-on {
    display: flex;
}

.survey-toast {
    position: fixed;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #323232;
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 100003;
    max-width: 90vw;
    text-align: center;
}

.survey-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.survey-success-msg {
    text-align: center;
    padding: 48px 24px;
}

.survey-success-msg h2 {
    font-weight: 400;
    margin-bottom: 12px;
}
