/* ============================================================
   ReviewIQ — Gating Page (Public)
   Customer-facing design: clean, warm, mobile-first.
   Uses CSS custom properties set inline on .riq-gate for
   brand colour customisation.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* --------------------------------------------------
   Root Variables (overridden inline per brand)
   -------------------------------------------------- */
.riq-gate {
    --riq-primary:      #2563EB;
    --riq-primary-dark: color-mix(in srgb, var(--riq-primary) 80%, black);
    --riq-stars:        #F59E0B;
    --riq-bg:           #F8FAFC;
    --riq-card-bg:      #FFFFFF;
    --riq-text:         #1E293B;
    --riq-muted:        #64748B;
    --riq-border:       #E2E8F0;
    --riq-radius:       16px;
    --riq-shadow:       0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --riq-font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --riq-transition:   all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------
   Wrapper
   -------------------------------------------------- */
.riq-gate {
    font-family: var(--riq-font);
    color: var(--riq-text);
    background: var(--riq-bg);
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------
   Step System
   -------------------------------------------------- */
.riq-step {
    width: 100%;
    max-width: 460px;
    animation: riqFadeUp 0.4s ease both;
}

.riq-step-hidden {
    display: none !important;
}

@keyframes riqFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------
   Card
   -------------------------------------------------- */
.riq-gate-card {
    background: var(--riq-card-bg);
    border-radius: var(--riq-radius);
    box-shadow: var(--riq-shadow);
    padding: 48px 32px 40px;
    text-align: center;
    border: 1px solid var(--riq-border);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
}

.riq-gate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--riq-primary), color-mix(in srgb, var(--riq-primary) 60%, #7c3aed));
    border-radius: var(--riq-radius) var(--riq-radius) 0 0;
}

.riq-card-positive::before {
    background: linear-gradient(90deg, #10B981, #34D399);
}

.riq-card-thankyou::before {
    background: linear-gradient(90deg, #10B981, #34D399);
}

/* --------------------------------------------------
   Icon
   -------------------------------------------------- */
.riq-gate-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 20px;
    display: block;
}

.riq-bounce {
    animation: riqBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.riq-pulse {
    animation: riqBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes riqBounce {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------
   Typography
   -------------------------------------------------- */
.riq-gate-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--riq-text);
    margin: 0 0 12px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.riq-gate-sub {
    font-size: 16px;
    color: var(--riq-muted);
    margin: 0 0 32px;
    line-height: 1.6;
}

/* --------------------------------------------------
   Star Selector
   -------------------------------------------------- */
.riq-stars-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.riq-star-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #CBD5E1;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--riq-transition);
    -webkit-tap-highlight-color: transparent;
}

.riq-star-btn svg {
    width: 36px;
    height: 36px;
    transition: var(--riq-transition);
}

.riq-star-btn:hover,
.riq-star-btn.riq-hovered,
.riq-star-btn.riq-selected {
    color: var(--riq-stars);
    transform: scale(1.15);
}

.riq-star-btn.riq-selected svg,
.riq-star-btn.riq-hovered svg {
    fill: var(--riq-stars);
}

.riq-star-btn:hover {
    background: color-mix(in srgb, var(--riq-stars) 10%, transparent);
}

/* Staggered pop on hover */
.riq-stars-selector:hover .riq-star-btn {
    transition-delay: 0ms;
}
.riq-star-btn:nth-child(1) { transition-delay: 0ms; }
.riq-star-btn:nth-child(2) { transition-delay: 20ms; }
.riq-star-btn:nth-child(3) { transition-delay: 40ms; }
.riq-star-btn:nth-child(4) { transition-delay: 60ms; }
.riq-star-btn:nth-child(5) { transition-delay: 80ms; }

/* --------------------------------------------------
   Buttons
   -------------------------------------------------- */
.riq-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--riq-primary);
    color: #fff;
    font-family: var(--riq-font);
    font-size: 16px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 10px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--riq-primary) 30%, transparent);
}

.riq-btn-primary:hover {
    background: var(--riq-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--riq-primary) 35%, transparent);
    color: #fff;
    text-decoration: none;
}

.riq-btn-primary:active {
    transform: translateY(0);
}

.riq-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.riq-google-btn {
    background: #fff;
    color: #1E293B;
    border: 1.5px solid var(--riq-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 0;
}

.riq-google-btn:hover {
    background: #F8FAFC;
    color: #1E293B;
    border-color: #CBD5E1;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.riq-restart-btn {
    background: none;
    border: none;
    font-family: var(--riq-font);
    font-size: 13px;
    color: var(--riq-muted);
    cursor: pointer;
    padding: 12px 8px 0;
    display: block;
    margin: 0 auto;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.riq-restart-btn:hover {
    color: var(--riq-text);
}

/* --------------------------------------------------
   Feedback Form
   -------------------------------------------------- */
.riq-feedback-form {
    text-align: left;
    margin-top: 4px;
}

.riq-field {
    margin-bottom: 18px;
}

.riq-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--riq-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.riq-optional {
    font-weight: 400;
    color: var(--riq-muted);
    font-size: 12px;
}

.riq-required {
    color: #EF4444;
}

.riq-field input,
.riq-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid var(--riq-border);
    border-radius: 8px;
    font-family: var(--riq-font);
    font-size: 15px;
    color: var(--riq-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    -webkit-appearance: none;
}

.riq-field input::placeholder,
.riq-field textarea::placeholder {
    color: #94A3B8;
}

.riq-field input:focus,
.riq-field textarea:focus {
    border-color: var(--riq-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--riq-primary) 15%, transparent);
}

.riq-field textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

.riq-field-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.riq-submit-btn {
    margin-top: 4px;
    margin-bottom: 0;
}

/* Spinner inside submit button */
.riq-submit-btn.riq-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: riqSpin 0.65s linear infinite;
    margin-left: 8px;
}

@keyframes riqSpin { to { transform: rotate(360deg); } }

/* --------------------------------------------------
   Google Escape Link
   -------------------------------------------------- */
.riq-google-escape {
    text-align: center;
    font-size: 12px;
    color: var(--riq-muted);
    margin: 16px 0 0;
    line-height: 1.5;
}

.riq-google-escape a {
    color: var(--riq-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.riq-google-escape a:hover {
    color: var(--riq-text);
}

/* --------------------------------------------------
   Responsive
   -------------------------------------------------- */
@media (max-width: 500px) {
    .riq-gate-card {
        padding: 36px 24px 32px;
    }

    .riq-gate-heading {
        font-size: 22px;
    }

    .riq-star-btn {
        width: 44px;
        height: 44px;
    }

    .riq-star-btn svg {
        width: 30px;
        height: 30px;
    }

    .riq-stars-selector {
        gap: 6px;
    }
}