/* ============================================
   CLIENT STYLES - GOODREVIEWS
   ============================================ */

:root {
    --color-bg: #f5f0e8;
    --color-text: #4a3728;
    --color-text-light: #8b7355;
    --color-primary: #c45c3e;
    --color-border: #c45c3e;
    --color-input-bg: #faf7f2;
    --color-input-border: #4a3728;
    --color-star-border: #666666;
    --color-star-filled: #ffd700;
    --font-title: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --radius-btn: 50px;
    --radius-input: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0 24px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    padding-top: 50px;
    padding-bottom: 120px;
    animation: fadeIn 0.3s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#screen-form {
    padding-bottom: 40px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Title */
.title {
    font-family: var(--font-title);
    font-size: var(--font-size-title, 28px);
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 48px;
    color: var(--color-text);
}

/* Stars Mode */
.stars-mode .title {
    font-family: var(--font-body);
    font-style: normal;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 24px;
}

/* Question Buttons */
.question-buttons {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 400px;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 40px;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover, .btn:active {
    background: var(--color-primary);
    color: white;
}

/* Stars */
.stars-container {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: clamp(4px, 2vw, 12px);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.star {
    display: grid;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.star-svg {
    width: clamp(48px, 12vw, 70px);
    height: auto;
    stroke: var(--color-star-border);
    stroke-width: 1.2;
    fill: transparent;
    transition: fill 0.15s ease, stroke 0.15s ease, transform 0.06s ease;
}

.star:hover .star-svg,
.star:hover ~ .star .star-svg {
    fill: var(--color-star-filled);
    stroke: var(--color-star-filled);
}

.star:active .star-svg { transform: scale(0.96); }

.star.selected .star-svg {
    fill: var(--color-star-filled);
    stroke: var(--color-star-filled);
}

/* Form */
.form-container {
    width: 100%;
    max-width: 400px;
}

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 16px 24px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background: transparent;
    border: 2px solid var(--color-text);
    border-radius: 50px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-text);
    box-shadow: 0 0 0 3px rgba(74, 55, 40, 0.1);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--color-text);
    opacity: 0.5;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a3728' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
    padding-right: 50px;
    cursor: pointer;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.5;
    border-radius: 24px;
}

.btn-submit {
    margin-top: 8px;
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-submit:hover, .btn-submit:active {
    background: var(--color-primary);
    color: white;
}

/* Success */
.success-title {
    font-family: var(--font-title);
    font-size: var(--font-size-title, clamp(28px, 7vw, 40px));
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--color-text);
}

.success-text {
    font-size: var(--font-size-body, 16px);
    color: var(--color-text);
    text-align: center;
    line-height: 1.6;
    width: 100%;
}

/* Logo Footer */
.logo-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: center;
    background: linear-gradient(to top, var(--color-bg) 70%, transparent);
    pointer-events: none;
    z-index: 1;
}

.logo-footer img {
    max-height: 60px;
    max-width: 180px;
    object-fit: contain;
    pointer-events: auto;
}

/* Logo inline dans le formulaire */
.form-logo {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.form-logo img {
    max-height: 60px;
    max-width: 180px;
    object-fit: contain;
}

/* Loading states */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading:hover::after {
    border-color: white;
    border-top-color: transparent;
}

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

/* Error states */
.form-input.error, .form-select.error, .form-textarea.error {
    border-color: #e53935;
}

/* Consent checkbox */
.form-consent {
    margin-top: 8px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.consent-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.consent-text {
    user-select: none;
}

/* Email error message */
.email-error-msg {
    color: #e53935;
    font-size: 12px;
    margin-top: 6px;
    padding-left: 24px;
    display: none;
}

.email-error-msg.visible {
    display: block;
}

/* Email typo suggestion */
.email-typo-suggestion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    font-size: 13px;
    animation: fadeIn 0.2s ease;
}

.typo-text {
    color: var(--color-text);
    flex: 1;
    min-width: 200px;
}

.typo-text strong {
    color: #10b981;
}

.typo-btn-yes, .typo-btn-no {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.typo-btn-yes {
    background: #10b981;
    color: white;
}

.typo-btn-yes:hover {
    background: #059669;
}

.typo-btn-no {
    background: transparent;
    color: var(--color-text-light);
    border: 1px solid var(--color-text-light);
}

.typo-btn-no:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Consent error state */
.form-consent.error .consent-label input[type="checkbox"] {
    outline: 2px solid #e53935;
    outline-offset: 2px;
}

/* Consent error message */
.consent-error-msg {
    color: #e53935;
    font-size: 12px;
    margin-top: 8px;
    padding-left: 28px;
    display: none;
}

.consent-error-msg.visible {
    display: block;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-text-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error screen */
.error-screen {
    text-align: center;
    padding: 48px 24px;
}

.error-icon { font-size: 64px; margin-bottom: 24px; }
.error-title { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.error-text { color: var(--color-text); }

/* Preview Mode Animation */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

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