/* SOULMATE SYSTEMS INC. - Classic Mac System 7 Style */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --mac-white: #ffffff;
    --mac-black: #000000;
    --mac-gray: #c0c0c0;
    --mac-dark-gray: #808080;
    --mac-light-gray: #dfdfdf;
    --mac-desktop: #6699cc;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'VT323', 'Chicago', 'Geneva', monospace;
    font-size: 20px;
    line-height: 1.4;
    background: var(--mac-desktop);
    background-image:
        linear-gradient(45deg, #5588bb 25%, transparent 25%),
        linear-gradient(-45deg, #5588bb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #5588bb 75%),
        linear-gradient(-45deg, transparent 75%, #5588bb 75%);
    background-size: 4px 4px;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

/* Mac Window */
.mac-window {
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    box-shadow: 2px 2px 0 var(--mac-black);
    max-width: 620px;
    margin: 20px auto;
}

.title-bar {
    background: var(--mac-white);
    border-bottom: 2px solid var(--mac-black);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    height: 22px;
}

.title-bar-lines {
    flex: 1;
    height: 12px;
    background: repeating-linear-gradient(
        to bottom,
        var(--mac-black) 0px,
        var(--mac-black) 1px,
        var(--mac-white) 1px,
        var(--mac-white) 3px
    );
}

.close-box {
    width: 13px;
    height: 11px;
    border: 1px solid var(--mac-black);
    background: var(--mac-white);
    margin-right: 6px;
    flex-shrink: 0;
}

.title-text {
    background: var(--mac-white);
    padding: 0 10px;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.window-content {
    padding: 24px;
}

/* Logo Section */
.logo-section {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--mac-black);
    margin-bottom: 20px;
}

.logo-heart {
    font-size: 48px;
    margin-bottom: 4px;
}

.logo-text {
    font-size: 28px;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.tagline {
    font-size: 16px;
    color: var(--mac-dark-gray);
}

/* Info Box */
.info-box {
    background: var(--mac-light-gray);
    border: 2px solid var(--mac-black);
    padding: 16px 20px;
    margin: 20px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted var(--mac-dark-gray);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--mac-dark-gray);
}

.info-value {
    font-weight: bold;
}

/* Section Headers */
h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 28px 0 16px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--mac-black);
}

/* Steps */
.steps {
    margin: 16px 0;
}

.step {
    display: flex;
    gap: 12px;
    margin: 14px 0;
    align-items: flex-start;
}

.step-num {
    width: 28px;
    height: 28px;
    background: var(--mac-black);
    color: var(--mac-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-text {
    padding-top: 3px;
}

/* Buttons */
.mac-btn {
    font-family: inherit;
    font-size: 18px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    border-radius: 6px;
    padding: 10px 28px;
    cursor: pointer;
    box-shadow:
        inset -1px -1px 0 var(--mac-dark-gray),
        inset 1px 1px 0 var(--mac-white);
}

.mac-btn:hover {
    background: var(--mac-light-gray);
}

.mac-btn:active {
    background: var(--mac-black);
    color: var(--mac-white);
    box-shadow:
        inset 1px 1px 0 var(--mac-dark-gray),
        inset -1px -1px 0 var(--mac-black);
}

.mac-btn.primary {
    background: var(--mac-black);
    color: var(--mac-white);
    box-shadow: 2px 2px 0 var(--mac-dark-gray);
}

.mac-btn.primary:hover {
    background: #333;
}

.mac-btn.primary:active {
    box-shadow: none;
    transform: translate(2px, 2px);
}

.cta-section {
    text-align: center;
    margin: 32px 0;
}

/* Alert Box */
.alert-box {
    background: var(--mac-white);
    border: 3px solid var(--mac-black);
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    gap: 16px;
    box-shadow: 4px 4px 0 var(--mac-black);
}

.alert-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
}

.alert-text p {
    margin: 0 0 8px 0;
}

.alert-text p:last-child {
    margin-bottom: 0;
}

.small {
    font-size: 16px;
    color: var(--mac-dark-gray);
}

/* Forms */
.form-section {
    margin: 20px 0;
}

.form-group {
    margin: 16px 0;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.mac-input {
    font-family: inherit;
    font-size: 18px;
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--mac-black);
    background: var(--mac-white);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}

.mac-input:focus {
    outline: none;
    box-shadow:
        inset 1px 1px 2px rgba(0,0,0,0.2),
        0 0 0 2px var(--mac-desktop);
}

.mac-textarea {
    font-family: inherit;
    font-size: 18px;
    width: 100%;
    padding: 10px;
    border: 2px solid var(--mac-black);
    background: var(--mac-white);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
    resize: vertical;
    min-height: 100px;
}

/* Validation Error States */
.validation-error {
    color: #cc0000;
    font-size: 16px;
    margin-top: 8px;
    display: none;
}

.validation-error.visible {
    display: block;
}

.mac-input.error,
.mac-textarea.error {
    border-color: #cc0000;
    box-shadow: inset 1px 1px 2px rgba(204,0,0,0.2);
}

/* Speech-to-Text Mic Button */
.textarea-container {
    position: relative;
}

.textarea-container .mac-textarea {
    padding-right: 50px;
}

.mic-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: 2px solid var(--mac-black);
    background: var(--mac-light-gray);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset -1px -1px 0 var(--mac-dark-gray),
        inset 1px 1px 0 var(--mac-white);
}

.mic-btn:hover {
    background: var(--mac-white);
}

.mic-btn:active {
    box-shadow:
        inset 1px 1px 0 var(--mac-dark-gray),
        inset -1px -1px 0 var(--mac-white);
}

.mic-btn.recording {
    background: var(--mac-black);
    color: var(--mac-white);
}

.rec-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    background: var(--mac-dark-gray);
    border-radius: 50%;
    margin-right: 3px;
}

.mic-btn.recording .rec-dot {
    background: #cc0000 !important;
    animation: rec-flash 0.5s infinite;
}

@keyframes rec-flash {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.3; }
}

.mic-btn.unsupported {
    display: none;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--mac-dark-gray);
    margin-top: 24px;
    font-size: 14px;
    color: var(--mac-dark-gray);
}

/* Response message */
.response {
    margin-top: 16px;
    padding: 12px;
    background: var(--mac-light-gray);
    border: 1px solid var(--mac-black);
}

.response.error {
    background: #ffdddd;
}

.response.success {
    background: #ddffdd;
}

/* ========== QUESTIONNAIRE STYLES ========== */

/* Progress Bar */
.progress-section {
    margin-bottom: 24px;
}

.progress-bar {
    height: 20px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
}

.progress-fill {
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        var(--mac-black),
        var(--mac-black) 4px,
        var(--mac-white) 4px,
        var(--mac-white) 8px
    );
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 16px;
    color: var(--mac-dark-gray);
}

/* Question Card */
.question-card {
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    margin: 20px 0;
    box-shadow: 2px 2px 0 var(--mac-black);
}

.question-header {
    background: var(--mac-light-gray);
    border-bottom: 2px solid var(--mac-black);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.question-tier {
    font-weight: bold;
}

.question-category {
    color: var(--mac-dark-gray);
}

.question-body {
    padding: 20px;
}

.question-prompt {
    font-size: 22px;
    margin-bottom: 20px;
    line-height: 1.3;
}

/* Slider */
.slider-container {
    margin: 24px 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--mac-dark-gray);
}

.mac-slider {
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    background: var(--mac-light-gray);
    border: 2px solid var(--mac-black);
}

.mac-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 30px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    cursor: pointer;
    box-shadow:
        inset -1px -1px 0 var(--mac-dark-gray),
        inset 1px 1px 0 var(--mac-white);
}

.mac-slider::-moz-range-thumb {
    width: 22px;
    height: 30px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    cursor: pointer;
}

/* Checkboxes */
.checkbox-group {
    margin: 16px 0;
}

.mac-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    cursor: pointer;
    padding: 8px;
    border: 1px solid transparent;
}

.mac-checkbox:hover {
    background: var(--mac-light-gray);
}

.mac-checkbox input {
    display: none;
}

.mac-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--mac-black);
    background: var(--mac-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.mac-checkbox input:checked + .checkmark::after {
    content: "✓";
    font-weight: bold;
}

.mac-checkbox input:checked ~ .checkbox-label {
    font-weight: bold;
}

/* Navigation */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--mac-dark-gray);
}

.nav-buttons .mac-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Tier Intro */
.tier-intro {
    text-align: center;
    padding: 20px;
}

.tier-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.tier-title {
    font-size: 24px;
    margin-bottom: 8px;
}

.tier-desc {
    color: var(--mac-dark-gray);
    max-width: 400px;
    margin: 0 auto 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .mac-window {
        margin: 10px auto;
    }

    .window-content {
        padding: 16px;
    }

    .logo-text {
        font-size: 22px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .nav-buttons .mac-btn {
        width: 100%;
    }
}

/* Cursor blink for playfulness */
.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}
