/* ============================================================
   SeaScape Owner Services Questionnaire — Master Stylesheet
   ============================================================ */

/* ── Custom Properties ──────────────────────────────────── */
:root {
    --primary: #5C4B3C;
    --accent: #C4A77D;
    --background: #F5F0EB;
    --text: #2C2520;
    --sea: #6B9DAD;

    --radius: 8px;
    --shadow: 0 2px 12px rgba(44, 37, 32, 0.10);
    --transition-fast: 200ms ease;
    --transition-smooth: 300ms ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Focus States (Accessibility) ───────────────────────── */
:focus-visible {
    outline: 2px solid var(--sea);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--sea);
    outline-offset: 2px;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
    background-color: var(--primary);
    padding: 0.75rem 1rem;
}

.header-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-flex;
    text-decoration: none;
}

.logo {
    height: 40px;
    width: auto;
    display: block;
}

/* ── Main Content ───────────────────────────────────────── */
.main {
    flex: 1;
    padding: 1.5rem 1rem;
    max-width: 1024px;
    margin: 0 auto;
    width: 100%;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
    background-color: var(--primary);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ── Card ───────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin: 1rem auto;
    max-width: 700px;
    width: 100%;
}

/* ── Error Card ─────────────────────────────────────────── */
.error-card {
    text-align: center;
    padding: 3rem 2rem;
}

.error-code {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    line-height: 1;
}

.error-message {
    font-size: 1.2rem;
    color: var(--text);
    margin: 0 0 2rem 0;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    display: inline-block;
    background-color: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color var(--transition-fast),
                border-color var(--transition-fast);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: #7A6654;
    border-color: #7A6654;
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color var(--transition-fast),
                color var(--transition-fast);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: var(--primary);
    color: #fff;
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress-bar-track {
    width: 100%;
    height: 8px;
    background-color: var(--primary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent);
    border-radius: 4px;
    transition: width var(--transition-smooth);
    min-width: 0;
}

/* ── Toggle Group (Yes / No) ────────────────────────────── */
.toggle-group {
    display: flex;
    gap: 0.5rem;
}

.toggle-group button {
    flex: 1;
    min-height: 48px;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: #fff;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast),
                color var(--transition-fast);
}

.toggle-group button:hover {
    background-color: var(--background);
}

.toggle-group button.selected,
.toggle-group button[aria-pressed="true"] {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Priority Group (1–5 pills) ─────────────────────────── */
.priority-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.priority-group button {
    width: 48px;
    height: 48px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition-fast),
                color var(--transition-fast);
}

.priority-group button:hover {
    background-color: var(--background);
}

.priority-group button.selected,
.priority-group button[aria-pressed="true"] {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Category Header ────────────────────────────────────── */
.category-header {
    width: 100%;
    background-color: var(--primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
}

.category-header:first-child {
    margin-top: 0;
}

/* ── Error Banner ───────────────────────────────────────── */
.error-banner {
    background-color: var(--sea);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ── Login Background ───────────────────────────────────── */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(6px) brightness(0.6);
    z-index: -1;
}

/* ── Form Inputs ────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d4cec7;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background-color: #fff;
    transition: border-color var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: var(--sea);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-group {
    margin-bottom: 1.25rem;
}

/* ── Responsive: mobile-first ───────────────────────────── */

/* Small screens (up to 640px) */
@media (max-width: 640px) {
    .card {
        margin: 0.5rem;
        padding: 1.25rem;
        border-radius: var(--radius);
        max-width: 100%;
    }

    .main {
        padding: 0.75rem 0.5rem;
    }

    .toggle-group {
        flex-direction: row;
    }

    .priority-group {
        gap: 0.35rem;
    }

    .priority-group button {
        width: 42px;
        height: 42px;
        font-size: 0.9rem;
    }

    .logo {
        height: 32px;
    }
}

/* Medium / large screens (above 1024px) */
@media (min-width: 1024px) {
    .card {
        max-width: 700px;
    }

    .main {
        max-width: 700px;
        padding: 2rem 1rem;
    }
}

/* ── Pack container ─────────────────────────────────────── */
.pack-container {
    max-width: 700px;
    margin: 1.5rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 2rem;
}

.pack-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 150ms ease;
}
.pack-item:last-child { border-bottom: none; }

.pack-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    margin: 0;
}

.pack-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.item-text { flex: 1; }

/* ── Language toggle ───────────────────────────────────────── */
.language-toggle {
    text-align: center;
    margin: 1rem 0;
}
.language-toggle a {
    display: inline-block;
    padding: 0.4rem 1rem;
    margin: 0 0.25rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--primary);
    font-size: 0.875rem;
}
.language-toggle a.active {
    background: var(--primary);
    color: #fff;
}

/* ── Pack navigation ───────────────────────────────────────── */
.pack-nav {
    max-width: 700px;
    margin: 1.5rem auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn-outline {
    background: transparent;
    color: var(--sea);
    border: 1px solid var(--sea);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
}
.btn-outline:hover { background: var(--sea); color: #fff; }

/* ── Free text in pack ─────────────────────────────────────── */
.free-text-item { flex-direction: column; align-items: stretch; }
.free-text-item label { margin-bottom: 0.5rem; font-weight: 500; }
.free-text-item textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

/* ── Resume card ───────────────────────────────────────────── */
.resume-card {
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
}
.resume-card h3 { color: var(--primary); margin-bottom: 0.5rem; }
.resume-card form { display: inline-block; margin: 0.5rem; }

/* ── Language selector ─────────────────────────────────────── */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.lang-btn {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: 2px solid var(--primary);
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
}
.lang-btn.selected, .lang-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ── Summary ───────────────────────────────────────────────── */
.summary-pack {
    max-width: 700px;
    margin: 1rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.5rem;
}
.summary-pack h3 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    color: #888;
}
.summary-item.checked { color: var(--text); font-weight: 500; }
.check-icon { width: 1.5rem; text-align: center; }
.summary-nav {
    max-width: 700px;
    margin: 1.5rem auto;
    display: flex;
    justify-content: space-between;
}

/* ── Character counter ─────────────────────────────────────── */
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.5;
    margin-top: 0.25rem;
}

/* ── Question Management (Admin) ──────────────────────────── */
.admin-header {
    max-width: 900px;
    margin: 1.5rem auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.question-mgmt-pack {
    max-width: 900px;
    margin: 1.5rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 1.5rem;
}
.question-mgmt-pack h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.question-mgmt-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.question-mgmt-item:last-child { border-bottom: none; }
.question-mgmt-item.hidden-item { opacity: 0.5; }
.item-header { display: flex; align-items: center; gap: 0.5rem; min-width: 60px; }
.visibility-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}
.item-sort-order { color: #999; font-size: 0.8rem; }
.item-texts { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.text-field { display: flex; align-items: center; gap: 0.5rem; }
.text-field label { font-size: 0.8rem; min-width: 45px; }
.text-input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}
.btn-save-text {
    background: var(--sea);
    color: #fff;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}
.btn-save-text:hover { opacity: 0.85; }

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
