/**
 * Autonexx Questionnaire System - Frontend Styles
 * Beautiful, Modern, Mobile-Responsive Form Design
 */

/* ========================================
   FORM WRAPPER
   ======================================== */

.aqs-form-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.aqs-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.aqs-form-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    line-height: 1.2;
}

.aqs-form-description {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   FORM SECTIONS
   ======================================== */

.aqs-customer-info,
.aqs-questions {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.05);
}

.aqs-customer-info h3,
.aqs-questions h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

/* ========================================
   FORM GROUPS
   ======================================== */

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

.aqs-form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.aqs-form-group .required {
    color: #ef4444;
    margin-left: 3px;
}

/* ========================================
   INPUT STYLES
   ======================================== */

.aqs-input,
.aqs-textarea,
.aqs-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.aqs-input:focus,
.aqs-textarea:focus,
.aqs-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.aqs-input:hover,
.aqs-textarea:hover,
.aqs-select:hover {
    border-color: #cbd5e1;
}

.aqs-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.aqs-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    appearance: none;
}

/* ========================================
   QUESTIONS
   ======================================== */

.aqs-question {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f1f5f9;
}

.aqs-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.aqs-question-text {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
    line-height: 1.5;
}

.aqs-question-text .required {
    color: #ef4444;
    margin-left: 3px;
}

/* ========================================
   RATING SYSTEM
   ======================================== */

.aqs-rating {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.aqs-rating-star {
    cursor: pointer;
    position: relative;
}

.aqs-rating-star input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.aqs-rating-star .star {
    display: inline-block;
    width: 45px;
    height: 45px;
    font-size: 36px;
    color: #cbd5e1;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 45px;
}

.aqs-rating-star:hover .star {
    color: #fbbf24;
    transform: scale(1.1);
}

.aqs-rating-star input:checked ~ .star {
    color: #fbbf24;
}

.aqs-rating-star input:checked ~ .star,
.aqs-rating-star input:checked ~ .star ~ .star {
    color: #fbbf24;
}

/* Hover effect for all stars up to hovered star */
.aqs-rating:hover .aqs-rating-star .star {
    color: #cbd5e1;
}

.aqs-rating .aqs-rating-star:hover .star,
.aqs-rating .aqs-rating-star:hover ~ .aqs-rating-star .star {
    color: #fbbf24;
}

/* ========================================
   CHOICE INPUTS (Radio & Checkbox)
   ======================================== */

.aqs-choice {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.aqs-choice:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.aqs-choice input[type="radio"],
.aqs-choice input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

.aqs-choice span {
    flex: 1;
    font-size: 15px;
    color: #1e293b;
    font-weight: 500;
}

.aqs-choice input:checked ~ span {
    color: #3b82f6;
    font-weight: 600;
}

/* ========================================
   FORM FOOTER
   ======================================== */

.aqs-form-footer {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.05);
    text-align: center;
}

.aqs-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    min-width: 200px;
}

.aqs-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(59, 130, 246, 0.4);
}

.aqs-submit-btn:active {
    transform: translateY(0);
}

.aqs-submit-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.aqs-form-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.aqs-form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.aqs-form-message.success {
    display: block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ========================================
   SUCCESS MESSAGE
   ======================================== */

.aqs-success-message {
    background: #fff;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.05);
}

.aqs-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto 20px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.aqs-success-message h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.aqs-success-message p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* ========================================
   LOADING STATE
   ======================================== */

.aqs-loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

@media (max-width: 768px) {
    .aqs-form-wrapper {
        margin: 10px auto;
        padding: 0 10px;
        max-width: 100%;
    }
    
    .aqs-form-title {
        font-size: 24px;
        padding: 20px 15px;
    }
    
    .aqs-form-description {
        font-size: 14px;
        padding: 0 15px 20px;
    }
    
    .aqs-customer-info,
    .aqs-questions,
    .aqs-form-footer {
        padding: 20px 15px;
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    /* Make all inputs touch-friendly (minimum 44px height) */
    .aqs-input,
    .aqs-textarea,
    .aqs-select {
        padding: 14px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .aqs-textarea {
        min-height: 120px;
    }
    
    /* Submit button - full width and touch-friendly */
    .aqs-submit-btn {
        width: 100%;
        padding: 16px 30px;
        font-size: 18px;
        min-height: 54px;
        margin-top: 10px;
    }
    
    /* Rating stars - larger for touch */
    .aqs-rating {
        justify-content: center;
        gap: 8px;
    }
    
    .aqs-rating-star .star {
        width: 48px;
        height: 48px;
        font-size: 36px;
        line-height: 48px;
    }
    
    /* Satisfaction scale - stack vertically on mobile */
/* Extra small phones (iPhone SE, etc) */
@media (max-width: 480px) {
    .aqs-form-title {
        font-size: 20px;
        padding: 15px 10px;
    }
    
    .aqs-customer-info h3,
    .aqs-questions h3 {
        font-size: 18px;
    }
    
    .aqs-form-wrapper {
        padding: 0 5px;
    }
    
    .aqs-rating-star .star {
        width: 42px;
        height: 42px;
        font-size: 32px;
        line-height: 42px;
    }
    
    /* Smaller gap between rating stars on very small screens */
    .aqs-rating {
        gap: 4px;
    }
    
    /* Ensure text doesn't overflow */
    .aqs-question-text,
    .aqs-form-description {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Landscape mobile - optimize horizontal space */
@media (max-width: 768px) and (orientation: landscape) {
/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* These are touch devices */
    
    /* Remove hover effects that don't work on touch */
    .aqs-rating-star .star:hover {
        transform: none;
    }
    
    /* Add active state for better touch feedback */
    .aqs-submit-btn:active {
        transform: scale(0.98);
    }
    
/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .aqs-submit-btn,
    .aqs-form-footer {
        display: none;
    }
    
    .aqs-customer-info,
    .aqs-questions {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}

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

.aqs-input:focus,
.aqs-textarea:focus,
.aqs-select:focus,
.aqs-choice:focus-within {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .aqs-choice {
        border-width: 3px;
    }
    
    .aqs-input,
    .aqs-textarea,
    .aqs-select {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .aqs-form-wrapper {
        color: #e2e8f0;
    }
    
    .aqs-customer-info,
    .aqs-questions,
    .aqs-form-footer,
    .aqs-success-message {
        background: #1e293b;
        color: #e2e8f0;
    }
    
    .aqs-form-title,
    .aqs-question-text,
    .aqs-customer-info h3,
    .aqs-questions h3 {
        color: #f1f5f9;
    }
    
    .aqs-form-description {
        color: #94a3b8;
    }
    
    .aqs-input,
    .aqs-textarea,
    .aqs-select,
    .aqs-choice {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .aqs-input:focus,
    .aqs-textarea:focus,
    .aqs-select:focus {
        border-color: #3b82f6;
        background: #1e293b;
    }
    
    .aqs-choice:hover {
        background: #0f172a;
        border-color: #3b82f6;
    }
}

/* Date Input Styling */
.aqs-form-field input[type="date"] {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aqs-form-field input[type="date"]:hover {
    border-color: #cbd5e1;
}

.aqs-form-field input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.aqs-form-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* Satisfaction Scale */
/* Responsive */
@media (max-width: 768px) {

/* ========================================
   SATISFACTION SCALE - CLEAN VERSION
   ======================================== */
.aqs-satisfaction-scale {
    display: flex !important;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.aqs-satisfaction-option {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px !important;
    border: 3px solid #e2e8f0 !important;
    border-radius: 16px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    position: relative;
    min-height: auto !important;
    box-shadow: none !important;
}

.aqs-satisfaction-option::before,
.aqs-satisfaction-option::after {
    display: none !important;
}

.aqs-satisfaction-option:hover {
    transform: translateY(-4px);
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25) !important;
}

.aqs-satisfaction-option input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.aqs-satisfaction-option input[type="radio"]:checked ~ .emoji {
    transform: scale(1.3);
}

.aqs-satisfaction-option input[type="radio"]:checked ~ .label {
    color: #1e293b !important;
    font-weight: 700 !important;
}

.aqs-satisfaction-option .emoji {
    font-size: 64px !important;
    display: block !important;
    margin-bottom: 12px;
    transition: transform 0.2s ease;
    line-height: 1 !important;
    background: none !important;
}

.aqs-satisfaction-option .label {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #475569 !important;
    line-height: 1.3;
    text-align: center;
    background: none !important;
}

@media (max-width: 768px) {
    .aqs-satisfaction-scale {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .aqs-satisfaction-option {
        flex: 0 0 calc(50% - 5px);
        padding: 20px 10px !important;
    }
    
    .aqs-satisfaction-option .emoji {
        font-size: 48px !important;
    }
    
    .aqs-satisfaction-option .label {
        font-size: 12px !important;
    }
}
