/**
 * Tour Reviews Form Styling
 * Jahongir Travel — UI/UX Consistency Spec v1.0
 * Based on design spec: tour-review-form-spec.txt
 */

/* ======================================================
   CSS VARIABLES
   ====================================================== */
:root {
    --bg-page: #FBFCFE;
    --bg-surface: #FFFFFF;
    --ink-1: #1A2233;
    --ink-2: #4A5874;
    --ink-3: #8A96AD;
    --stroke-1: #E5E8F0;
    --brand-primary: #2A62E8;
    --brand-primary-600: #1F54CC;
    --brand-accent: #FFA63D;
    --brand-accent-hover: #FFC864;
    --error-color: #E45858;
}

/* ======================================================
   REVIEW SUBMISSION FORM
   ====================================================== */

.review-form-wrapper {
    margin-top: 64px; /* Increased separation from reviews section */
    padding: 0;
}

/* White card container - matches "Included" sections */
.review-form {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 48px 32px; /* 48px top/bottom, 32px sides per spec */
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
    border: 1px solid var(--stroke-1);
    border-top: 3px solid var(--stroke-1); /* Subtle top accent for visual separation */
}

.review-form-title {
    font-size: 28px; /* H2 - 28px/36px */
    line-height: 36px;
    font-weight: 600;
    color: var(--ink-1);
    margin: 0 0 16px 0; /* 16px bottom margin per spec */
}

.review-form-subtitle {
    font-size: 16px; /* Body-1 - 16px/26px */
    line-height: 26px;
    color: var(--ink-2);
    margin: 0 0 32px 0;
}

/* ======================================================
   STAR RATING INPUT
   ====================================================== */

.star-rating-input {
    margin: 12px 0 16px 0;
}

.star-buttons {
    display: flex;
    gap: 8px; /* 8px gap per spec */
    margin-bottom: 8px; /* 8px gap between stars and label */
}

.star-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-btn svg {
    display: block;
    width: 24px; /* 24px size per spec */
    height: 24px;
    fill: #E5E7EB; /* Light gray fill - no borders */
    transition: all 0.2s ease;
}

.star-btn:hover svg {
    fill: var(--brand-accent-hover); /* #FFC864 on hover */
    transform: scale(1.05);
}

.star-btn.active svg,
.star-btn.selected svg {
    fill: var(--brand-accent); /* #FFA63D when active */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rating-label {
    display: inline-block;
    font-size: 14px;
    line-height: 22px;
    color: var(--ink-3);
    font-weight: 500;
    transition: color 0.2s ease;
}

.rating-label.selected {
    color: var(--ink-1);
    font-weight: 600;
}

/* ======================================================
   FORM ELEMENTS
   ====================================================== */

.review-form .form-group {
    margin-bottom: 24px; /* 24px field spacing per spec */
}

.review-form .form-group label {
    display: block;
    font-size: 14px; /* 14px/22px per spec */
    line-height: 22px;
    font-weight: 500; /* Medium weight */
    margin-bottom: 8px; /* Label-to-input gap: 8px */
    color: var(--ink-2);
}

.review-form .form-group input,
.review-form .form-group textarea {
    width: 100%;
    padding: 12px 16px; /* 12px 16px per spec */
    border: 1px solid var(--stroke-1);
    border-radius: 8px;
    font-size: 16px; /* 16px/26px per spec */
    line-height: 26px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-surface);
    color: var(--ink-1);
}

.review-form .form-group input::placeholder,
.review-form .form-group textarea::placeholder {
    color: var(--ink-3);
}

.review-form .form-group input:focus,
.review-form .form-group textarea:focus {
    outline: 2px solid var(--brand-primary); /* 2px solid #2A62E8 per spec */
    outline-offset: 1px;
    border-color: var(--brand-primary);
}

.review-form .form-group textarea {
    resize: vertical;
    min-height: 140px; /* 140px per spec */
    line-height: 26px;
}

.review-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 640px) {
    .review-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Required indicator */
.required {
    color: var(--error-color);
}

/* Field hint / helper text */
.field-hint {
    display: block;
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 6px;
    line-height: 1.5;
}

/* Error messages */
.error-message {
    display: none;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.5;
}

.error-message:not(:empty) {
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: var(--error-color);
}

/* Character count */
.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 6px;
}

/* ======================================================
   FORM ACTIONS
   ====================================================== */

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 32px; /* Button top margin: 32px */
    padding-bottom: 40px; /* Button bottom padding: 40px */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 14px 20px; /* 14px 20px per spec */
    border-radius: 10px; /* 10px per spec */
    font-size: 16px; /* 16px/26px per spec */
    line-height: 26px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: inherit;
    border: none;
}

.btn--primary {
    background: var(--brand-primary); /* #2A62E8 per spec */
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    width: 100%; /* Full width desktop per spec */
}

.btn--primary:hover:not(:disabled) {
    background: var(--brand-primary-600); /* #1F54CC per spec */
    transform: translateY(-2px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--primary:focus-visible {
    outline: 2px solid var(--brand-primary-600);
    outline-offset: 2px;
}

.btn-loader {
    display: none;
}

/* ======================================================
   FORM MESSAGES
   ====================================================== */

.form-message {
    display: none;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.form-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.form-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.form-message:not(:empty) {
    display: block;
}

/* ======================================================
   RESPONSIVE DESIGN
   ====================================================== */

@media (max-width: 768px) {
    .review-form-wrapper {
        margin-top: 32px;
    }

    .review-form {
        padding: 32px 24px;
    }

    .review-form-title {
        font-size: 24px;
        line-height: 32px;
    }

    .review-form-subtitle {
        font-size: 15px;
        line-height: 24px;
    }

    .star-btn svg {
        width: 22px;
        height: 22px;
    }

    .btn--primary {
        width: 100%; /* Keep 100% on tablet/mobile */
    }

    .form-actions {
        justify-content: stretch;
        margin-top: 24px;
        padding-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .review-form {
        padding: 24px 16px;
    }

    .review-form-title {
        font-size: 22px;
        line-height: 30px;
    }

    .star-buttons {
        justify-content: center;
        gap: 6px;
    }

    .btn--primary {
        width: 100%; /* Full width on mobile */
    }

    .form-actions {
        padding-bottom: 24px;
    }
}

/* ======================================================
   ACCESSIBILITY
   ====================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Form validation animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.form-group.error input,
.form-group.error textarea {
    animation: shake 0.3s ease;
}

/* Focus visible for keyboard navigation */
.star-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn:focus-visible {
    outline: 2px solid var(--brand-primary-600);
    outline-offset: 2px;
}
