/*************************************************************
   SmartPaw Quiz - Optimized & Compact Design
   Wider on Desktop, Compact on Mobile
*************************************************************/

/* ═══════════════════════════════════════════════════════════
   BASE & BODY
   ═══════════════════════════════════════════════════════════ */
.smartpaw-quiz-body {
    background: #f7f9fc;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    padding: 0;
    margin: 0;
}

.smartpaw-quiz-wrapper {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */
.sp-progress {
    height: 5px;
    background: #e5e7eb;
    overflow: hidden;
}

.sp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════
   STEP CONTAINER
   ═══════════════════════════════════════════════════════════ */
.sp-step {
    padding: 28px 40px 32px;
}

.sp-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    text-align: center;
}

.sp-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
    text-align: center;
}

.sp-label {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.sp-form {
    margin-bottom: 20px;
}

.sp-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.sp-form input,
.sp-form select,
.sp-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.sp-form input:focus,
.sp-form select:focus,
.sp-form textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.sp-form textarea {
    resize: vertical;
    min-height: 70px;
}

/* ═══════════════════════════════════════════════════════════
   EMAIL VALIDATION FEEDBACK
   ═══════════════════════════════════════════════════════════ */
#email-feedback {
    display: block;
    margin-top: -8px;
    margin-bottom: 12px;
    font-size: 12px;
    min-height: 16px;
    transition: all 0.3s ease;
    font-weight: 500;
}

#email-feedback.error {
    color: #dc3545;
}

#email-feedback.success {
    color: #28a745;
}

/* ═══════════════════════════════════════════════════════════
   AVATAR UPLOAD
   ═══════════════════════════════════════════════════════════ */
.sp-avatar-upload {
    text-align: center;
    margin-bottom: 20px;
}

.sp-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.sp-avatar-icon {
    font-size: 40px;
}

.sp-upload-label {
    display: inline-block;
    padding: 8px 20px;
    background: #4f46e5;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sp-upload-label:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

#sp_avatar {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   FREQUENCY CARDS
   ═══════════════════════════════════════════════════════════ */
.sp-frequency {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.sp-freq-card {
    padding: 14px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sp-freq-card:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.sp-freq-card.active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    transform: scale(1.02);
}

.sp-freq-card.active .sp-freq-title,
.sp-freq-card.active .sp-freq-desc {
    color: #fff;
}

.sp-freq-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 3px;
    line-height: 1.3;
}

.sp-freq-desc {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════
   DAY SELECTION INFO
   ═══════════════════════════════════════════════════════════ */
.sp-day-info,
#day-selection-info {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    padding: 8px 12px;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 3px solid #4f46e5;
}

/* ═══════════════════════════════════════════════════════════
   DAY PILLS GRID
   ═══════════════════════════════════════════════════════════ */
.sp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.sp-day-pill {
    padding: 10px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-weight: 500;
    font-size: 13px;
    color: #374151;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-day-pill:hover {
    border-color: #4f46e5;
    background: #f9fafb;
}

.sp-day-pill.active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION BUTTONS
   ═══════════════════════════════════════════════════════════ */
.sp-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
}

.sp-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sp-next,
.sp-finish {
    background: #4f46e5;
    color: #fff;
}

.sp-next:hover,
.sp-finish:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sp-next:disabled,
.sp-finish:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.sp-back {
    background: #f3f4f6;
    color: #374151;
}

.sp-back:hover {
    background: #e5e7eb;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE OPTIMIZATION
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .smartpaw-quiz-wrapper {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .sp-step {
        padding: 20px 18px 24px;
    }
    
    .sp-title {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .sp-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .sp-form label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .sp-form input,
    .sp-form select,
    .sp-form textarea {
        padding: 9px 12px;
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .sp-avatar-preview {
        width: 90px;
        height: 90px;
    }
    
    .sp-avatar-icon {
        font-size: 36px;
    }
    
    .sp-frequency {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .sp-freq-card {
        min-height: 65px;
        padding: 12px 10px;
    }
    
    .sp-days {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }
    
    .sp-day-pill {
        padding: 8px 4px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .sp-nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .sp-btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    #day-selection-info {
        font-size: 12px;
        padding: 7px 10px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .sp-step {
        padding: 18px 16px 22px;
    }
    
    .sp-days {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .sp-day-pill {
        min-height: 40px;
    }
}

/* Large desktop - extra spacing */
@media (min-width: 1200px) {
    .smartpaw-quiz-wrapper {
        max-width: 1000px;
    }
    
    .sp-step {
        padding: 32px 60px 36px;
    }
}
/* ═══════════════════════════════════════════════════════════
   DATE PICKER STYLES
   ═══════════════════════════════════════════════════════════ */

.sp-dates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
}

.sp-date-card {
    padding: 14px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sp-date-card:hover {
    border-color: #4f46e5;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.sp-date-card.active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    transform: scale(1.02);
}

.sp-date-day {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.sp-date-card.active .sp-date-day {
    opacity: 0.9;
}

.sp-date-display {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.sp-date-info {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    padding: 10px 14px;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
}

/* Mobile styles */
@media (max-width: 768px) {
    .sp-dates {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        max-height: 350px;
        padding: 12px;
    }
    
    .sp-date-card {
        padding: 12px 10px;
        min-height: 65px;
    }
    
    .sp-date-display {
        font-size: 12px;
    }
    
    .sp-date-day {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .sp-dates {
        grid-template-columns: repeat(2, 1fr);
    }
}