/*
 * Mark Salon - Form Styling
 * Color Theme Mapping:
 *  --main-bg: #0e221f (Dark Forest Green)
 *  --primary-accent: #f3bf85 (Soft Gold / Peach)
 *  --text-color: #eaf0ee (Pale Mint / Off-White)
 *  --secondary-accent: #25d366 (Bright Green)
 */

:root {
    --main-bg: #0e221f;
    --primary-accent: #f3bf85;
    --text-color: #eaf0ee;
    --secondary-accent: #25d366;
    
    --border-color: rgba(243, 191, 133, 0.3);
    --option-bg: rgba(255, 255, 255, 0.03);
    --option-hover-bg: rgba(243, 191, 133, 0.08);
    --option-selected-bg: rgba(243, 191, 133, 0.15);
    --error-color: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 30px 15px;
}

/* Form Main Container */
.review-container {
    background-color: var(--main-bg);
    border: 1px solid var(--border-color);
    max-width: 680px;
    width: 100%;
    padding: 45px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(243, 191, 133, 0.05);
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 35px;
}

.salon-logo {
    max-width: 130px;
    height: auto;
    margin-bottom: 20px;
    display: inline-block;
}

.header-section .main-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.header-section .sub-title {
    font-size: 15px;
    font-weight: 400;
    color: var(--primary-accent);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto;
}

.header-line {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-accent), transparent);
    opacity: 0.6;
    margin-top: 25px;
}

/* Form Groups & Cards */
.form-group {
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

.form-group.has-error {
    border-radius: 14px;
    padding: 15px;
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.question-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
    letter-spacing: 0.2px;
}

.required {
    color: var(--primary-accent);
    font-weight: 700;
}

/* Radio Cards (Q1, Q3, Q4) */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--option-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.25s ease;
    position: relative;
    user-select: none;
}

.radio-option:hover {
    background: var(--option-hover-bg);
    border-color: var(--primary-accent);
    transform: translateY(-1px);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 14px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.radio-option:hover .custom-radio {
    border-color: var(--primary-accent);
}

.radio-option input[type="radio"]:checked ~ .custom-radio {
    border-color: var(--primary-accent);
    box-shadow: 0 0 10px rgba(243, 191, 133, 0.3);
}

.radio-option input[type="radio"]:checked ~ .custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--primary-accent);
    border-radius: 50%;
}

.radio-option:has(input[type="radio"]:checked) {
    background: var(--option-selected-bg);
    border-color: var(--primary-accent);
    box-shadow: 0 4px 15px rgba(243, 191, 133, 0.15);
}

.option-text {
    flex-grow: 1;
}

/* Emoji Group (Q2) */
.emoji-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.emoji-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 6px;
    border-radius: 14px;
    background: var(--option-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    outline: none;
}

.emoji-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.emoji {
    font-size: 30px;
    filter: grayscale(80%) opacity(0.5);
    transition: all 0.3s ease;
    display: inline-block;
}

.emoji-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
    margin-top: 8px;
    opacity: 0.8;
    transition: opacity 0.25s ease;
    text-align: center;
}

.emoji-option:hover {
    background: var(--option-hover-bg);
    border-color: var(--primary-accent);
    transform: translateY(-2px);
}

.emoji-option:hover .emoji {
    filter: grayscale(0%) opacity(0.9);
    transform: scale(1.1);
}

.emoji-option:has(input[type="radio"]:checked) {
    background: var(--option-selected-bg);
    border-color: var(--primary-accent);
    box-shadow: 0 6px 20px rgba(243, 191, 133, 0.2);
    transform: translateY(-3px);
}

.emoji-option:has(input[type="radio"]:checked) .emoji {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.2);
}

.emoji-option:has(input[type="radio"]:checked) .emoji-label {
    color: var(--text-color);
    font-weight: 700;
    opacity: 1;
}

/* Focus outline for accessibility */
.emoji-option:focus-visible,
.radio-option:focus-within {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

/* Textarea Wrapper (Q5) */
.textarea-wrapper {
    margin-top: 10px;
}

textarea#writtenReview {
    width: 100%;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--main-bg);
    color: var(--text-color);
    font-family: inherit;
    resize: vertical;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

textarea#writtenReview::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

textarea#writtenReview:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(243, 191, 133, 0.25);
}

/* Submit Button */
.submit-btn {
    background-color: var(--primary-accent);
    color: var(--main-bg);
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 6px 25px rgba(243, 191, 133, 0.25);
}

.submit-btn:hover {
    background-color: #f7cf9e;
    box-shadow: 0 8px 30px rgba(243, 191, 133, 0.4);
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(1px);
}

/* Popup Overlay */
.popup-overlay, .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(14, 34, 31, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.popup-content {
    background-color: var(--main-bg);
    border: 1px solid var(--secondary-accent);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(37, 211, 102, 0.2);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.hidden .popup-content {
    transform: translateY(25px);
}

.success-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(37, 211, 102, 0.15);
    color: var(--secondary-accent);
    border: 2px solid var(--secondary-accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.popup-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--secondary-accent);
}

.popup-content p {
    color: var(--text-color);
    font-size: 15px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.close-btn {
    background-color: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-btn:hover {
    background-color: var(--primary-accent);
    color: var(--main-bg);
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(234, 240, 238, 0.15);
    border-top: 4px solid var(--primary-accent);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-overlay p {
    color: var(--text-color);
    font-weight: 600;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    body {
        padding: 15px 10px;
    }
    
    .review-container {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .header-section .main-title {
        font-size: 21px;
    }

    .header-section .sub-title {
        font-size: 14px;
    }

    .emoji-group {
        gap: 6px;
    }

    .emoji-option {
        padding: 12px 4px;
        border-radius: 10px;
    }

    .emoji {
        font-size: 24px;
    }

    .emoji-label {
        font-size: 10px;
    }
}
